高手指教!(麻烦写得详细点,谢谢)

解决方案 »

  1.   

    楼主如果很吝啬,不愿意说出你的具体需求,那我只能写成这个样子了。public class Point {
      private final int x;
      private final int y;
      public Point() {
        this.x = 0;
        this.y = 0;
      }
      public Point(int x, int y) {
        this.x = x;
        this.y = y;
      }
      public int getX() {
        return this.x;
      }
      public int getY() {
        return this.y;
      }
      public String toString() {
        return "(" + this.x + "," + this.y + ")";
      }
    }
      

  2.   

    麻烦注释下,我刚接触JAVA,看不大明白