Programming  Java  Exception

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

throws throw finalize finally

Share this QA

2. URL throws an exception called

IllegalURLException URLException MalformedHostException MalformedURLException

Share this QA

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 this QA

4. Which class is base class for all exceptions?

String Error Throwable RuntimeException

Share this QA

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 this QA

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

MemoryBoundException OutOfMemoryError OutOfRangeException NullReferenceException

Share this QA

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 this QA

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

Exception FileNotFoundException ReadException IOException

Share this QA

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

ArrayIndexOutOfBoundsException StringOverFlowException StringException StringIndexOutOfBoundsException

Share this QA

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

Object Throwable AWT Panel

Share this QA

 

*Click on the QNo to display a Question.

Total Ans