Leave a Reply 2

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


pojo

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