Oracle
1Z0-809 · Question #141
1Z0-809 Question #141: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #141. The question stem and answer options stay visible for context.
Question
Given:
class MyField {
int x, y;
public void doStuff(int x, int y) {
this.x = x;
this.y = y;
}
public void display() {
System.out.println(x + ":" + y + " ");
}
public static void main(String[] args) {
MyField m1 = new MyField();
m1.x = 100;
m1.y = 200;
MyField m2 = new MyField();
m2.doStuff(m1.x, m1.y);
m1.display();
m2.display();
}
}
What is the result?Options
- A100 : 0 ; 100 : 200
- B100 : 200 ; 100 : 200
- C100 : 200 ; 100 : 0
- D100 : 0 ; 100 : 0
Unlock 1Z0-809 to see the answer
You've previewed enough free 1Z0-809 questions. Unlock 1Z0-809 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.