22 lines
402 B
Java
22 lines
402 B
Java
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);
|
|
}
|
|
}
|