Oracle
1Z0-809 · Question #261
Given: public class Counter { public static void main (String[] args) { int a = 10; int b = 1; assert (b >=-1) : "Invalid Denominator"; int c = a / b; System.out.println (c); } } What is the result…
The correct answer is C. An AssertionError is thrown. You've hit your session limit · resets 5:20pm (America/New_York)
Question
Given:
public class Counter {
public static void main (String[] args) {
int a = 10;
int b = 1;
assert (b >=-1) : "Invalid Denominator";
int c = a / b;
System.out.println (c);
}
}
What is the result of running the code with the -ea option?
Options
- A-10
- B0
- CAn AssertionError is thrown.
- DA compilation error occurs.
How the community answered
(48 responses)- A13% (6)
- B4% (2)
- C75% (36)
- D8% (4)
Explanation
You've hit your session limit · resets 5:20pm (America/New_York)
Community Discussion
No community discussion yet for this question.