![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Objekt-orienteret programmering i Java, del 1 - slide 17 : 27 |
class Point{ private double x, y; public Point(){ this(0.0, 0.0); } public Point(double x){ this.x = x; this.y = 0.0; } public Point(double x, double y){ this.x = x; this.y = y; } public Point(Point p){ this(p.x, p.y); } // Evt. Point methoder her public String toString(){ return ("Punktet" + "(" + x + "," + y + ")"); } } // end class Point |
|