Question 18
Back to Exercise
What does javac do with a statement written directly after return; in the same block?
- A Ignores it
- B Reports an "unreachable statement" error Correct
- C Runs it before returning
- D Warns but compiles
Correct Answer: Option B
Unreachable statements are compile errors in Java.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!