帮忙看看。执行错误、、、、
public class Common {
int A,B,C;
public void speed() {
// TODO Auto-generated method stub
}
}
class Plane extends Common{
public Plane(int i, int j, int k) {
// TODO Auto-generated constructor stub
}
public void speed() {
// TODO Auto-generated method stub
System.out.println("Plane的速度为"+(A+B+C));
}
}
class Car007 extends Common{
public Car007(int i, int j, int k) {
// TODO Auto-generated constructor stub
}
public void speed() {
// TODO Auto-generated method stub
System.out.println("Car007的速度为"+(A*B/C));
}
}
public class test {
public static void main(String[] args) {
// TODO Auto-generated method stub
Common v =new Car007(10,10,10);
System.out.println("Caroo7运行1000千米需要"+(1000/v.speed())+"小时!");
v = new Plane(10,10,10);
System.out.println("Plane运行1000千米需要"+(1000/v.speed())+"小时!");
}
}