Java Exceptions MCQs with answers
79 questions tagged Java Exceptions, each with the correct answer and an explanation. Page 2 of 4.
- Which method in Throwable is used to get the cause of exception?
- What happens if finally block has a return statement?
- What is the correct way to declare a method that throws multiple exceptions?
- Which exception is thrown when a thread is waiting or sleeping and is interrupted?
- What is the result of dividing by zero using floating point in Java?
- Which of these is NOT a feature of exception handling in Java?
- What does multi-catch block allow in Java 7+?
- What is the default behavior when an exception occurs and is not caught?
- Can we catch Error in Java?
- What does `super(message)` do in a custom exception class?
- Which type of exception must be either caught or declared?
- Which of these is the base class for all errors and exceptions?
- What happens if an exception is thrown inside a catch block?
- Which method can be used to get the detail message of an exception?
- What is the correct order of blocks in Java exception handling?
- Can we use `try` without a `catch` block?
- Which exception occurs when parsing an invalid number format?
- Which of these exceptions is thrown if an application tries to use `null` in a case where an object is required?
- Which block executes even when a return statement is encountered in the try block?
- Which of these methods are present in the Throwable class?