求解 错误在哪
public class Vehicle{double speed=0;
int power=0;
void speedUp(int x){
speed+=x;
}
void speedDown(int x){
speed-=x;
}
void setPower(int x){
power=x;
}
int getPower(){
return(power);
}
double gerSpeed(){
return(speed);
}
}
public class User{
public static void main(String args[]){
Vehicle car1,car2;
car1=new Vehicle();car2=new Vehicle();
car1.setPower(128);car2.setPower(76);
System.out.println("car1:"+car1.power);System.out.println("car2:"+car2.power);
car1.speedUp(80);car2.speedUp(80);
System.out.println("car1:"+car1.speed);System.out.println("car2:"+car2.speed);
car1.speedDown(10);car2.speedDown(20);
System.out.println("car1:"+car1.speed);System.out.println("car2:"+car2.speed);
}
} 错误提示 Vehicle must be defined User.java