What is the result?

Given:
public class TestField {
int x;
int y;
public void doStuff(int x, int y) {
this.x = x; y =this.y;
}
public void display() {
System.out.print(x + " " + y + " : ");
}
public static void main(String[] args) {
TestField m1 = new TestField(); m1.x = 100; m1.y = 200;
TestField m2 = new TestField();
m2.doStuff(m1.x, m1.y);
m1.display();
m2.display();
}
}
What is the result?
A. 100 200 : 100 200
B. 100 0 : 100 0 :
C. 100 200 : 100 0 :
D. 100 0 : 100 200 :

Download Printable PDF. VALID exam to help you PASS.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.