0

programming languages Online Quiz - 192

Description: programming languages Online Quiz - 192
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0
  1. compiler error

  2. smaller type is promoted

  3. must explicitly cast

  4. none of the above


Correct Option: B

A class can define two methods with the same name as long as the return types are different

  1. True

  2. False


Correct Option: B

All exceptions inherit from

  1. java.lang.Exception

  2. java.lang.Error

  3. java.lang.Throwable

  4. none of the above


Correct Option: C
  1. compiler error

  2. smaller type is promoted

  3. must explicitly cast

  4. none of the above


Correct Option: B
  1. compiletime error at lines 1,2,3,4

  2. compiletime error at line 3

  3. compiletime error at line 1

  4. compiletime error at lines 3,4


Correct Option: D
  1. compile time error at line1

  2. compile time error at line2

  3. Run time exception

  4. None Of the above


Correct Option: B

What type of inheritance does Java have?

  1. Single Inheritence

  2. Double Inheritence

  3. Multiple Inheritence

  4. Class Inheritence


Correct Option: A

Java runs on.

  1. Windows

  2. Unix

  3. Solaris

  4. All of the above


Correct Option: D

The Java interpreter is used for the execution of the source code.

  1. True

  2. False


Correct Option: A

A Vector is declared as follows. What happens if the code tried to add 6 th element to this Vector new vector(5,10)

  1. The element will be successfully added

  2. ArrayIndexOutOfBounds Exception

  3. The Vector allocates space to accommodate up to 15 elements

  4. None of the above


Correct Option: A,C

Which is the data structure used to store sorted map elements

  1. HashSet

  2. Hashmap

  3. Map

  4. TreeMap


Correct Option: D

Which of the following is true ?

  1. Stateless session beans doesn’t preserve any state across method calls

  2. Stateful session beans can be accesses by multiple users at the same time

  3. None of the above

  4. Allof the above


Correct Option: A

Stateful Session beans contain

  1. Home Interface

  2. Remote Interface

  3. Bean Class

  4. All of the above


Correct Option: D

A method is defined in a class as : void processUser(int i) { } If this method is overriden in a sub class,

  1. the new method should return int

  2. the new method can return any type of values

  3. the argument list of new method should exactly match that of overriden method

  4. the return type of new method should exactly match that of overriden method


Correct Option: C,D

What is the output of following piece of code ? int x = 2; switch (x) { case 1:System.out.println(”1?); case 2: case 3:System.out.println(”3?); case 4: case 5:System.out.println(”5?);

  1. No output

  2. 3 and 5

  3. 1, 3 and 5

  4. 3


Correct Option: B

In the init(ServletConfig) method of Servlet life cycle, what method can be used to access the ServletConfig object

  1. getServletInfo()

  2. getInitParameters()

  3. getServletConfig()

  4. None of the above


Correct Option: C
- Hide questions