Which exceptions must be either caught or declared in a throws clause?
A
Unchecked exceptions such as NullPointerException
B
Checked exceptions such as IOException
Correct answer
C
Errors such as OutOfMemoryError
D
Runtime exceptions such as ArithmeticException
Correct answer
B. Checked exceptions such as IOException
16 views
⚔️
Challenge a friend on JAVA
Same MCQs, timed, live leaderboard. Send the link on WhatsApp – no sign-up needed.
Create challenge
Explanation
Checked exceptions are verified at compile time, so code must handle them with try/catch or declare them with throws. RuntimeException subclasses and Errors are unchecked.
Reference
Asked in: NTS, OCA Java, Technical Interviews
Doubts & discussionNot sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ
‹ Previous MCQ Which Java collection does not allow duplicate elements? Next MCQ › Which method signature lets the JVM start a standalone Java application?