package com.homework.zw; public class Point { private int x; private int y; Point(int x, int y) { this.x = x; this.y = 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; } }
package com.homework.zw; public class A { public static void main(String[] args) { Point po=new Point(25,30); System.out.println("x="+po.getX()+" y="+po.getY()); po.setX(200); po.setY(250); System.out.println("x="+po.getX()+" y="+po.getY()); } }