nerdexam
Oracle

1Z0-815 · Question #75

What is the result? Class StaticField { static int i = 7; public static void main(String[] args) { StaticFied obj = new StaticField(); obj.i++; StaticField.i++; obj.i++…

The correct answer is A. 10 10. See the full explanation below for the reasoning.

Question

What is the result? Class StaticField { static int i = 7; public static void main(String[] args) { StaticFied obj = new StaticField(); obj.i++; StaticField.i++; obj.i++; System.out.println(StaticField.i + " "+ obj.i); } }

Options

  • A10 10
  • B8 9
  • C9 8
  • D7 10

How the community answered

(14 responses)
  • A
    79% (11)
  • B
    14% (2)
  • D
    7% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-815 Practice