AI-assisted, automatically checked• Updated August 2026

Java Exception Handling MCQs

Practice MCQs on Java try-catch-finally, checked vs unchecked exceptions, throw, and throws keywords.

5 MCQsSubtopic of JavaProgrammingAll Levels
Subtopic Focus & Conceptual Depth

Deep-dive into Exception Handling principles within Java. These targeted questions evaluate edge-cases, common pitfalls, and interview problem patterns.

Skill Level
Focused Subtopic Mastery
Explanation Depth
Code Snippets & Analysis
Exam Scope
Campus Hiring & GATE CS

Core Java Fundamentals Quiz

10 questions · Interactive timed test · Instant score & review

Other Java Subtopics

Exception Handling MCQ Questions

Page 1 of 1 (5 total)
Q1

What is the purpose of the 'finally' block in Java exception handling?

medium
View Answer & Explanation
Correct Answer: It contains code that always runs whether or not an exception was thrown
Explanation:
The finally block is commonly used to close resources like files or database connections, since it executes regardless of whether the try block succeeded or an exception occurred.
Q2

What is the purpose of the 'throws' keyword in a Java method signature?

medium
View Answer & Explanation
Correct Answer: It declares that a method might throw a specific checked exception, which the caller must handle or propagate
Explanation:
Using throws is different from actually throwing an exception with the throw keyword. It simply warns callers that they need to be ready to catch or rethrow the listed exception.
Q3

What happens when you divide an integer by zero in Java?

medium
View Answer & Explanation
Correct Answer: It throws an ArithmeticException at runtime
Explanation:
Integer division by zero is not defined and Java raises an ArithmeticException. Dividing a floating point number by zero, however, produces Infinity or NaN instead of an exception.
Q4

What is the difference between checked and unchecked exceptions in Java?

medium
View Answer & Explanation
Correct Answer: Checked exceptions must be declared or handled at compile time, while unchecked exceptions are not required to be handled
Explanation:
Checked exceptions like IOException extend Exception but not RuntimeException, forcing the compiler to check that they are caught or declared. Unchecked exceptions extend RuntimeException and skip this requirement.
Q5

Which of the following is a checked exception in Java?

medium
View Answer & Explanation
Correct Answer: IOException
Explanation:
IOException is a checked exception that must be declared in a throws clause or caught, whereas NullPointerException, ArithmeticException, and ArrayIndexOutOfBoundsException are unchecked RuntimeExceptions.