Exception Handling – Multiple Choice Questions (MCQs)
-
-
2. Which block is used to enclose the code that might throw an exception?
-
3. Which block is used to handle the exception that occurred in the `try` block?
-
4. Which block is always executed, regardless of whether an exception occurred or not?
-
5. Which keyword is used to explicitly throw an exception?
-
6. What is the superclass of all exception classes in Java?
-
7. What are the two main categories of exceptions in Java?
-
8. What are checked exceptions in Java?
-
9. What are unchecked exceptions in Java?
-
10. Which class is the superclass of all unchecked exceptions in Java?
-
11. Which of the following is a common checked exception in Java?
-
12. Which of the following is a common unchecked exception in Java?