Question 20
Back to Exercise
Since Java 14, what does a NullPointerException message tell you?
- A Nothing new
- B Exactly which reference was null and what the code tried to do with it Correct
- C The line number only
- D How to fix the bug automatically
Correct Answer: Option B
For example: Cannot invoke "String.length()" because "name" is null.
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!