Oracle
1Z0-804 · Question #46
Given: And the command-line invocation: Java Tracker 12 11 What is the result?
The correct answer is B. class InvalidAgeException. The second argument 11 makes the program to throw an InvalidAgeException due to the line: throw new InvalidAgeException ();
Exceptions and Assertions
Question
Given:
And the command-line invocation:
Java Tracker 12 11 What is the result?
Exhibit
Options
- AGeneral category
- Bclass InvalidAgeException
- Cclass java.lang.IllegalArgumentException
- Dclass java.lang.RuntimeException
How the community answered
(30 responses)- A17% (5)
- B70% (21)
- C3% (1)
- D10% (3)
Explanation
The second argument 11 makes the program to throw an InvalidAgeException due to the line: throw new InvalidAgeException ();
Topics
#custom exception#exception hierarchy#throw#catch
Community Discussion
No community discussion yet for this question.
