package java1; public class Point { int x; 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; } } Point a1=new Point(1,2); { a1.setX(10); System.out.println("X="+a1.getX()+
package com.hanqi.test; public class Point { private int x; private int y; Point(int xx,int yy) { x=xx; y=yy; } public int getX() { return x; } public int getY() { return y; } } Point pt=,); System.out.println("x值是"+pt.getX()+"y的值是"+pt