CoreJava/exp3/Car.java

22 lines
402 B
Java
Raw Normal View History

2024-05-09 09:10:51 +08:00
package exp3;
public class Car extends Vehicle {
//成员属性
int loader;
public Car(){
super();
this.loader = 0;
}
public Car(String brand, int wheels, float weight, int loader){
super(brand, wheels, weight);
this.loader = loader;
}
void show(){
super.show();
System.out.println("载人数: "+this.loader);
}
}