CoreJava/exp3/Trunk.java
2024-05-09 09:10:51 +08:00

22 lines
434 B
Java

package exp3;
public class Trunk extends Car {
//成员属性
float payload;
public Trunk(){
super();
this.payload = 0;
}
public Trunk(String brand, int wheels, float weight, int loader, float payload){
super(brand, wheels, weight, loader);
this.payload = payload;
}
void show(){
super.show();
System.out.println("载重数: "+this.payload);
}
}