Multi-Language Programming Quiz: Java, Perl, and Python
Test your knowledge across multiple programming languages including Java, Perl, and Python. Covers language features, data structures, syntax, and programming concepts.
Questions
Source code is written in
- Spaces, tabs & linefeeds
- Kernel
- Haskell
- Nutshell
Which other programming language uses whitespace syntax
- Java
- Cobra
- VC++
- Python
Data is represented by
- Decimal
- Hexadecimal
- Octadecimal
- Binary
- None of the above
import java.util.*; class GFC113 { public static void main (String[] args) { Object m = new LinkedHashSet(); System.out.print((m instanceof Collection)+","); System.out.print((m instanceof Set)+","); System.out.print(m instanceof HashSet); }} What is the result of attempting to compile and run the program?
- Prints: false,false,false
- Prints: false,true,false
- Prints: true,false,true
- Prints: true,true,true
- None of the above
import java.util.*; class GFC118 { public static void main (String[] args) { Object i = new ArrayList().listIterator(); System.out.print((i instanceof List)+","); System.out.print((i instanceof Iterator)+","); System.out.print(i instanceof ListIterator); }} What is the result of attempting to compile and run the program?
- Prints: false,false,false
- Prints: false,true,false
- Prints: false,true,true
- Prints: true,true,false
- Prints: true,true,true
• Stores key/value pairs. • Duplicate entries replace old entries. • Provides constant-time performance for the add, contains and remove operations. Which of these classes provides the specified features?
- LinkedHashMap
- LinkedHashSet
- TreeSet
- HashMap
- HashSet
- Hashtable
Perl is a ___________ language?
- Compiled
- Interpreted
- Both
- None
Which of the following is a true statement?
- All implementations of the List interface provide fast random access.
- A LinkedList provides faster random access than an ArrayList.
- The LinkedList implements the RandomAccess interface.
- The RandomAccess interface declares the next and hasNext methods.
- None of the above.
Perl is Developed by__________?
- Henry Spencer
- Larry B
- Larry Wall
- Jhon
Perl was Originally called "Gloria".
- True
- False
Which of the following classes would provide the most efficient implementation of a First In First Out queue?
- ArrayList
- LinkedHashMap
- LinkedHashSet
- LinkedList
- TreeMap
- Vector
Perl Expanded as_______________?
- Practically Extracted Reporting Language
- Practical Extraction report Language
- Practical Extraction and report Language
- Practical Export and report Language
Perl is slower than sed and awk
- True
- False
Perl Variables can declared in lexical scope.
- True
- False
Perl libraries are defined in terms of __________?
- Modules
- Classes
- Packages
- Libraies
An interpreted language like perl is never execute as fast as a compiled language.
- True
- False
Perl is Written to be Practical. It means it is..?
- Complete
- Easy to use
- Efficient
- Not agreed with above three
The most popular use Perl is generating webpage dynamically
- True
- False
class SRC104 { public static void main (String[] args) { System.out.print(Math.round(Float.NaN)); }} What is the result of attempting to compile and run the program?
- Prints: NaN
- Prints: 0.0
- Prints: 0
- Compile-time error
- Run-time error
class D { public static void main (String args[]) { Byte a = new Byte("1"); byte b = a.byteValue(); short c = a.shortValue(); char d = a.charValue(); int e = a.intValue(); long f = a.longValue(); float g = a.floatValue(); double h = a.doubleValue(); System.out.print(b+c+d+e+f+g+h); }} What is the result of attempting to compile and run the program?
- Prints: 7
- Prints: 7.0
- Compile-time error
- Run-time error
- None of the above