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)- A76% (16)
- C14% (3)
- D5% (1)
- E5% (1)
Community Discussion
No community discussion yet for this question.