What is the result? Given: What is the result? Given: What is the result? A. x: 1 y: 2 B. x: 0 y: 0 C. 3 y: 4 D. x: 0 y: 0 E. 3 y: 4 F. x: 1 y: 2 G. 0 y: 0 Show Hint ← Previous question Next question →
pojo public void doThis(int x, int y){ x=x; y=x; System.out.println(“x:”+this.x+” y:”+ this.y); } public void doThat(int x, int y){ this.x=x; this.y=y; System.out.println(“x:”+this.x+” y:”+ this.y); } public static void main(String[] args) { test t= new test(); t.doThis(1 , 2); t.doThat(3, 4); } ==> x:0 y:0 x:3 y:4 Reply
public void doThis(int x, int y){
x=x;
y=x;
System.out.println(“x:”+this.x+” y:”+ this.y);
}
public void doThat(int x, int y){
this.x=x;
this.y=y;
System.out.println(“x:”+this.x+” y:”+ this.y);
}
public static void main(String[] args) {
test t= new test();
t.doThis(1 , 2);
t.doThat(3, 4);
}
==> x:0 y:0 x:3 y:4
00
34