Java Exceptions MCQs with answers
79 questions tagged Java Exceptions, each with the correct answer and an explanation. Page 4 of 4.
- Which class is the parent of RuntimeException?
- What is the output? try { int x = 5 / 0; } catch (Exception e) { System.out.print("Caught"); }
- What is the type of all exceptions that are not checked?
- Can multiple catch blocks be used with one try block?
- Which exception is thrown when an object reference is null?
- Which of the following is true about exception propagation?
- What will happen? int a = 10 / 0;
- Can a try block exist without a catch block?
- Which exception is thrown when accessing an array with invalid index?
- What does `throws` keyword indicate?
- Which of these is a checked exception?
- Which exception is thrown when a number is divided by zero?
- Which block is always executed whether an exception occurs or not?
- What happens if an exception is not caught?
- Which keyword is used to manually throw an exception?
- What is the purpose of the `finally` block?
- Which of the following is an unchecked exception?
- What is the superclass of all exceptions in Java?
- Exception created by try block is caught in which block