Exception Handling in Java - Questions and Answers for Java Examinations
Questions
6
When the JVM runs out of memory, which exception will be thrown?
Answer: Option [B]
When a program is stopped due to lack of memory then OutOfMemoryError is thrown.
7
In Java programming environment, the throw keyword is used
Answer: Option [A]
In Java throw keyword is used to handle exception programmatically.
⭐ Make GKSeries Your Preferred Source on Google
Add GKSeries as Preferred Source
8
Which exception is thrown by read() method ?
Answer: Option [D]
IOException is thrown when I/O operation is failed.
9
Attempting to access a character that is outside the bounds of a StringBuffer results in a
Answer: Option [D]
10
Exception and Error are immediate subclasses of a class called
Answer: Option [B]
Throwable is a superclass of all Error and Exception classes.