class Test3{ public static void main(String[] arg){ Pt o1=new Pt(10,20); o1.pl(); o1.change(); o1.pl(); } } class Pt{ int x,y,z; Pt(){ } Pt(int x,int y){ this.x=x; this.y=y; this.z=x; } void change(){ this.x=this.y; this.y=this.z; } void pl() { System.out.println("X坐标:"+x+";Y坐标:"+y); } }