0
Alien head

programming languages Online Quiz - 308

Description: programming languages Online Quiz - 308
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

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


Correct Option: C

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


Correct Option: C

The most popular use Perl is generating webpage dynamically

  1. True

  2. False


Correct Option: A

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

  1. Complete

  2. Easy to use

  3. Efficient

  4. Not agreed with above three


Correct Option: A,B,C

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

  1. True

  2. False


Correct Option: A

Perl libraries are defined in terms of __________?

  1. Modules

  2. Classes

  3. Packages

  4. Libraies


Correct Option: A

Perl Variables can declared in lexical scope.

  1. True

  2. False


Correct Option: A

Perl is slower than sed and awk

  1. True

  2. False


Correct Option: B

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


Correct Option: C

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


Correct Option: D

Perl was Originally called "Gloria".

  1. True

  2. False


Correct Option: A

Perl is Developed by__________?

  1. Henry Spencer

  2. Larry B

  3. Larry Wall

  4. Jhon


Correct Option: C

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.


Correct Option: E

Perl is a ___________ language?

  1. Compiled

  2. Interpreted

  3. Both

  4. None


Correct Option: B

• 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


Correct Option: A,D,F

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


Correct Option: C

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


Correct Option: D

Data is represented by

  1. Decimal

  2. Hexadecimal

  3. Octadecimal

  4. Binary

  5. None of the above


Correct Option: D

Which other programming language uses whitespace syntax

  1. Java

  2. Cobra

  3. VC++

  4. Python


Correct Option: D

Source code is written in

  1. Spaces, tabs & linefeeds

  2. Kernel

  3. Haskell

  4. Nutshell


Correct Option: C
+ View questions