17

package arraylistlearning;
public class MyPoint4D extends Point3D{
public int t;
public MyPoint4D(int x, int y, int z,int t) {
super(x, y, z);
if(t<0) {System.out.println("TIME ERROR!");this.t=0;}
else this.t=t;
}
public void move(int x,int y,int z,int t){
super.move(x,y,z);
if(t<0) {System.out.println("TIME ERROR!");this.t=0;}
else this.t=t;
}
public void translate(int x,int y,int z,int t){
super.translate(x,y,z);
this.t+=t;
if(t<0) {System.out.println("TIME ERROR!");this.t=0;}
}
public int getTime(){
if(0==t) System.out.println("TIME MAYBE ERROR!");
return t;
}
}

原文地址:https://www.cnblogs.com/acm-icpcer/p/6536315.html