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.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Source code is written in

  1. Spaces, tabs & linefeeds
  2. Kernel
  3. Haskell
  4. Nutshell
Question 2 Multiple Choice (Single Answer)

Which other programming language uses whitespace syntax

  1. Java
  2. Cobra
  3. VC++
  4. Python
Question 3 Multiple Choice (Single Answer)

Data is represented by

  1. Decimal
  2. Hexadecimal
  3. Octadecimal
  4. Binary
  5. None of the above
Question 4 Multiple Choice (Single Answer)

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?

  1. Prints: false,false,false
  2. Prints: false,true,false
  3. Prints: true,false,true
  4. Prints: true,true,true
  5. None of the above
Question 5 Multiple Choice (Single Answer)

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?

  1. Prints: false,false,false
  2. Prints: false,true,false
  3. Prints: false,true,true
  4. Prints: true,true,false
  5. Prints: true,true,true
Question 6 Multiple Choice (Multiple Answers)

• 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?

  1. LinkedHashMap
  2. LinkedHashSet
  3. TreeSet
  4. HashMap
  5. HashSet
  6. Hashtable
Question 7 Multiple Choice (Single Answer)

Perl is a ___________ language?

  1. Compiled
  2. Interpreted
  3. Both
  4. None
Question 8 Multiple Choice (Single Answer)

Which of the following is a true statement?

  1. All implementations of the List interface provide fast random access.
  2. A LinkedList provides faster random access than an ArrayList.
  3. The LinkedList implements the RandomAccess interface.
  4. The RandomAccess interface declares the next and hasNext methods.
  5. None of the above.
Question 9 Multiple Choice (Single Answer)

Perl is Developed by__________?

  1. Henry Spencer
  2. Larry B
  3. Larry Wall
  4. Jhon
Question 10 True/False

Perl was Originally called "Gloria".

  1. True
  2. False
Question 11 Multiple Choice (Multiple Answers)

Which of the following classes would provide the most efficient implementation of a First In First Out queue?

  1. ArrayList
  2. LinkedHashMap
  3. LinkedHashSet
  4. LinkedList
  5. TreeMap
  6. Vector
Question 12 Multiple Choice (Single Answer)

Perl Expanded as_______________?

  1. Practically Extracted Reporting Language
  2. Practical Extraction report Language
  3. Practical Extraction and report Language
  4. Practical Export and report Language
Question 13 True/False

Perl is slower than sed and awk

  1. True
  2. False
Question 14 True/False

Perl Variables can declared in lexical scope.

  1. True
  2. False
Question 15 Multiple Choice (Single Answer)

Perl libraries are defined in terms of __________?

  1. Modules
  2. Classes
  3. Packages
  4. Libraies
Question 16 True/False

An interpreted language like perl is never execute as fast as a compiled language.

  1. True
  2. False
Question 17 Multiple Choice (Multiple Answers)

Perl is Written to be Practical. It means it is..?

  1. Complete
  2. Easy to use
  3. Efficient
  4. Not agreed with above three
Question 18 True/False

The most popular use Perl is generating webpage dynamically

  1. True
  2. False
Question 19 Multiple Choice (Single Answer)

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?

  1. Prints: NaN
  2. Prints: 0.0
  3. Prints: 0
  4. Compile-time error
  5. Run-time error
Question 20 Multiple Choice (Single Answer)

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?

  1. Prints: 7
  2. Prints: 7.0
  3. Compile-time error
  4. Run-time error
  5. None of the above