private String name; // for identification purposes
private double price; // price per meter
private double widthOfFlooring; // meter
public Flooring(String initName, double initPrice, double initWidth) {
name = initName;
price = initPrice;
widthOfFlooring = initWidth;
}
public String getName() {
return name;
}
public double getPricePerM() {
return price;
}
public double getWidth() {
return widthOfFlooring;
}
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/