Home » Oracle » 1z0-803 » Which two are possible outputs?
Given:
Which two are possible outputs?
A. Option A
B. Option B
C. Option C
D. Option D
Correct Answer: AD
Explanation/Reference:
Explanation:
The first println statement, System.out.println("Before if clause");, will always run.
If Math.Random() > 0.5 then there is an exception. The exception message is displayed and the program terminates.
If Math.Random() > 0.5 is false, then the second println statement runs as well.
Incorrect answers:
B: The second println statement would not run.
C: The first println statement will always run.
Download Printable PDF. VALID exam to help you PASS.
|
|