Programming  Java  Exception

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

throws throw finalize finally

Share QNo: 1

2. URL throws an exception called

IllegalURLException URLException MalformedHostException MalformedURLException

Share QNo: 2

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

Share QNo: 3

4. Which class is base class for all exceptions?

String Error Throwable RuntimeException

Share QNo: 4

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

Share QNo: 5

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

MemoryBoundException OutOfMemoryError OutOfRangeException NullReferenceException

Share QNo: 6

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

Share QNo: 7

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

Exception FileNotFoundException ReadException IOException

Share QNo: 8

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

ArrayIndexOutOfBoundsException StringOverFlowException StringException StringIndexOutOfBoundsException

Share QNo: 9

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

Object Throwable AWT Panel

Share QNo: 10


*Click on the QNo to display a Question.

Total Ans