public class Point { private int x; private int y; public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; } public void setY(int y) { this.y = y; } public void Point() { this.x = x; this.y = y; } }
package b; import a.Point; public class A { public static void main(String[] args) { Point shu=new Point(); shu.setX(2); shu.setY(3); System.out.println("x="+shu.getX()); System.out.println("y="+shu.getY()); } }