uni-assignments

University programming assignments
git clone git://git.christosmarg.xyz/uni-assignments.git
Log | Files | Refs | README | LICENSE

Point.java (443B)


      1 class Point {
      2         double x;
      3         double y;
      4 
      5         Point() {
      6                 this.x = 0.0;
      7                 this.y = 0.0;
      8         }
      9 
     10         Point(double x, double y) {
     11                 this.x = x;
     12                 this.y = y;
     13         }
     14         
     15         Point(Point p) {
     16                 this.x = p.x;
     17                 this.y = p.y;
     18         }
     19 
     20         public String toString() {
     21                 return "(" + x + ", " + y + ")";
     22         }
     23 }