图片是需求,Drink 的类怎么建立啊,求大神帮我
public class Material {
private String name;
private int pirce;
public Material() {
}
public Material(String name, int pirce) {
super();
this.name = name;
this.pirce = pirce;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getPirce() {
return pirce;
}
public void setPirce(int pirce) {
this.pirce = pirce;
}
public void add(){
System.out.println();
}
}
public class MinorMaterial extends Material { public MinorMaterial() { } public MinorMaterial(String name, int pirce) { super(name, pirce); } } public class MainMaterial extends Material { public MainMaterial() { } public MainMaterial(String name, int pirce) { super(name, pirce); } }
NadiaSmile
雪舞蔷薇
望远
相关分类