Programming  Java  Exception

1. Which of the following does not deal with exceptions?

throws throw finalize finally

Workspace

Comments

2. URL throws an exception called

IllegalURLException URLException MalformedHostException MalformedURLException

Workspace

Comments

3. Event handling is done by objects which

Contain code for running an applet Contain code for creating a window Contain code for responding to an event generated by a logical input device Contain code for responding to program generated exceptions

Workspace

Comments

4. Which class is base class for all exceptions?

String Error Throwable RuntimeException

Workspace

Comments

5. Java’s exception handling mechanism is meant to handle

only compile time errors only syntax errors only runtime errors both runtime and compile time errors

Workspace

Comments

6. When the JVM runs out of memory, which exception will be thrown?

MemoryBoundException OutOfMemoryError OutOfRangeException NullReferenceException

Workspace

Comments

7. In Java programming environment, the throw keyword is used

to generate exception programmatically to throw exception object to catch exception object none of the above

Workspace

Comments

8. Which exception is thrown by read() method ?

Exception FileNotFoundException ReadException IOException

Workspace

Comments

9. Attempting to access a character that is outside the bounds of a StringBuffer results in a

ArrayIndexOutOfBoundsException StringOverFlowException StringException StringIndexOutOfBoundsException

Workspace

Comments

10. Exception and Error are immediate subclasses of a class called

Object Throwable AWT Panel

Workspace

Comments

 

*Click on the QNo to display a Question.

Total Ans