展开全部
public class AutoMobile {
protected int numbersOfWheels;
protected String autoMobileColor;
protected int autoMobileWeight;
protected int speed;
public AutoMobile(){
this(4,"黑色32313133353236313431303231363533e4b893e5b19e31333332616531",100);
}
public AutoMobile(int numbersOfWheels,String autoMobileColor,int autoMobileWeight){
this.numbersOfWheels=numbersOfWheels;
this.autoMobileColor=autoMobileColor;
this.autoMobileWeight=autoMobileWeight;
this.speed=0;
}
public void speedUp() {
speed++;
System.out.println("这是AutoMobile的加速方法,当前速度:" + speed);
}
public void speedDown() {
speed--;
System.out.println("这是AutoMobile的减速方法,当前速度:" + speed);