Java MCQ – Exception Handling – Part 2
This collection of Java Multiple Choice Questions and Answers (MCQs): Quizzes & Practice Tests with Answer focuses on “Exception Handling in Java”.
1. Which of these classes is a super class of all Exception classes?
A RuntimeExceptions
B String
C Throwable
D Cachable

2. Which of these classes is related to all the exceptions that can be caught using catch?
A Error
B Exception
C RuntimeExecption
D All the answers are true
3. Which of these classes is related to all the exceptions that cannot be caught?
A Error
B Exception
C RuntimeExecption
D All the answers are true
4. Which of these operators is used to generate an instance of an exception which can be thrown using throw?
A new
B malloc
C throws
D thrown
5. What is the output of the following code?
public class Main { public static void main(String args[]) { try { int a = 5 / 0; System.out.print("TRY"); } catch(ArithmeticException e) { System.out.print("CATCH"); } } }
A TRY
B CATCH
C TRYCATCH
D CATCHTRY
6. Which block is always executed, regardless of the exception thrown?
A throws
B finally
C catch
D throw
7. Exception and Error are direct subclasses of _____
A Throwable
B BaseException
C RuntimeException
D Object

8. FileNotFoundException
A Inherits from the IOException class
B Is an exception at compile time
C Found in the java.io package
D All the answers are true
9. IOException
A Is a subclass of Exception
B Is an exception at compile time
C Found in the java.io package
D All the answers are true
10. The multiple catch syntax was introduced in _____
A java 5
B java 6
C java 7
D java 8