Programming  Java  Exception

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

throws throw finalize finally

2. URL throws an exception called

IllegalURLException URLException MalformedHostException MalformedURLException

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

4. Which class is base class for all exceptions?

String Error Throwable RuntimeException

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

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

MemoryBoundException OutOfMemoryError OutOfRangeException NullReferenceException

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

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

Exception FileNotFoundException ReadException IOException

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

ArrayIndexOutOfBoundsException StringOverFlowException StringException StringIndexOutOfBoundsException

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

Object Throwable AWT Panel

 

*Click on the QNo to display a Question.

Total Ans

 

 

';
Aptitude Coaching - Free Live Session !!