nerdexam
Oracle

1Z0-809 · Question #159

Given the code fragment: public class Test { static int count = 0; int i = 0; public void changeCount() { while (i < 5) { count++; i++; } } public static void main(String[] args) { Test check1 = new…

The correct answer is A. 10 : 10. You've hit your session limit · resets 10:20pm (America/New_York)

Question

Given the code fragment: public class Test { static int count = 0; int i = 0; public void changeCount() { while (i < 5) { count++; i++; } } public static void main(String[] args) { Test check1 = new Test(); Test check2 = new Test(); check1.changeCount(); check2.changeCount(); System.out.print(check1.count + ":" + check2.count); } } What is the result?

Options

  • A10 : 10
  • B5 : 10
  • CCompilation fails.
  • D5 : 5

How the community answered

(53 responses)
  • A
    83% (44)
  • B
    9% (5)
  • C
    2% (1)
  • D
    6% (3)

Explanation

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

Community Discussion

No community discussion yet for this question.

Full 1Z0-809 Practice