坐标点的移动

作者在 2007-05-15 21:10:00 发布以下内容

public class Usepoint {
    public static void main(String[] args) {
        Point P1=new Point();
         Point P2=new Point();
         P1.move(2,2);
         P2.move(3,3);
        Usepoint usepoint = new Usepoint();
    }
}
class Point{
    int x=1;
    int y=1;

    public void move(int a,int b){
            x=a;
            y=b;
            System.out.println("点移动后的坐标为:"+"("+x+","+y+")");
    }
}

默认分类 | 阅读 1975 次
文章评论,共0条
游客请输入验证码
浏览20002次
文章分类
最新评论