nerdexam
Oracle

1Z0-815 · Question #85

Given: public class ScopeTest { int j, int k; public static void main(String[] args) { ew ScopeTest().doStuff(); } void doStuff() { nt x = 5; oStuff2(); System.out.println("x"); } void doStuff2() {…

The correct answer is A. j B. k. See the full explanation below for the reasoning.

Question

Given:

public class ScopeTest { int j, int k; public static void main(String[] args) { ew ScopeTest().doStuff(); } void doStuff() { nt x = 5; oStuff2(); System.out.println("x"); } void doStuff2() { nt y = 7; ystem.out.println("y"); or (int z = 0; z < 5; z++) { ystem.out.println("z"); ystem.out.println("y"); } Which two items are fields?

Options

  • Aj
  • Bk
  • Cx
  • Dy
  • Ez

How the community answered

(21 responses)
  • A
    76% (16)
  • C
    14% (3)
  • D
    5% (1)
  • E
    5% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-815 Practice