class MyPoint{
int x;
int y;
MyPoint(int x, int y){
this.x = x;
this.y = y;
}
public String toString(){
return "("+x+", "+y+")";
}
}
public class Test{
public static void main(String[] args){
MyPoint p = new MyPoint(100,100);
func(p);
System.out.println(p);
}
static void func(MyPoint a){
a.x = 10;
}
}
|