this
-
Java - this.개발노하우/Java 2007. 4. 18. 12:56
class Exam01_sub{ private int x; private int y; public Exam01_sub() { this.x=100; this.y=200; } public void setXY(int x,int y) { this.x = x; this.y = y; } public void disp() { System.out.println("x=" + this.x); System.out.println("y=" + this.y); } } public class thisp{ public static void main(String[] arg) { Exam01_sub ex = new Exam01_sub(); ex.disp(); ex.setXY(10,20); ex.disp(); } }