package fengda;
class Point1 {
private int x,y;
public void setPoint (int a,int b) {
x=a;
y=b;
}
public int getx()
{
return x;
}
public int gety ()
{
return y;
}
public String toString()
{
return"["+x+","+y+"]";
}
}
public class fengda01{
public static void main(String args[]) {
int a1=4;
int b1=5;
Point1 abc=new Point1();
abc.setPoint(a1,b1);
System.out.println("x="+abc.getx());
System.out.println("y="+abc.gety());
System.out.println(abc.toString());
}
}
作者:温柔仅仅对她
链接:https://www.jianshu.com/p/a53750e7337d
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。