12345678910111213141516171819202122232425262728 |
- class Point2 {
- protected double x;
- protected double y;
- Point2(double x, double y) {
- this.x = x; this.y = y;
- }
- public getPos() {
- System.out.println(this.x + " " + this.y);
- }
- }
- class Point3 extends Point2{
- protected double z;
- Point2(double x, double y, double z) {
- super(x, y); this.z = z;
- }
- public getPos() {
- System.out.println(this.x + " " + this.y + " " + this.z);
- }
- }
|