nerdexam
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)
  • A
    13% (6)
  • B
    4% (2)
  • C
    75% (36)
  • D
    8% (4)

Explanation

You've hit your session limit · resets 5:20pm (America/New_York)

Community Discussion

No community discussion yet for this question.

Full 1Z0-809 Practice