Tag: programming languages

Questions Related to programming languages

An exception can be caught by a catch block with an argument type that is a superclass of the thrown exception.

  1. True

  2. False


Correct Option: A

a method cannot be declared as throwing more than one exception.

  1. True

  2. False


Correct Option: B

can you have a final abstract class?

  1. True

  2. False


Correct Option: B

an abstract class can have a constructor?

  1. True

  2. False


Correct Option: A

It is legal to access a static method using an instance of the class?

  1. True

  2. False


Correct Option: A

assuming all variables are declared and initialized properly this will compile. for(i=l; k< 5; j++){};

  1. True

  2. False


Correct Option: A

EJB stands for ....

  1. Enterprise Java Bean

  2. Enter Java Bean

  3. Exceptional Java Bean

  4. Event Java Bean


Correct Option: A

It is not possible to have an instance of a non-static inner class before any instances of the outer class have been created.

  1. True

  2. False


Correct Option: A

If method A declares that it throws an exception and method B calls method A,then method B must ALWAYS declare the same exception.

  1. True

  2. False


Correct Option: B

This is legal. float f = 2;

  1. Yes

  2. No

  3. Compile error

  4. Don't know


Correct Option: A