coffeebrewer.java

来自「ssd3部分quiz、exercise、exam的参考答案」· Java 代码 · 共 55 行

JAVA
55
字号

public class CoffeeBrewer extends Product {
	
		/*
	 * (non-javadoc)
	 */
	private String model;
	
	/*
	 * (non-javadoc)
	 */
	private String waterSupply;
	
	/*
	 * (non-javadoc)
	 */
	private int numberOfCups;
	
	public CoffeeBrewer(String initialCode, 
	        String initialDescription, 
	        double initialPrice,
	        String initialModel,
	        String initialWaterSupply,
	        int initialNumberOfCups) {
		super(initialCode, initialDescription, initialPrice);
		this.model = initialModel;
		this.waterSupply = initialWaterSupply;
		this.numberOfCups = initialNumberOfCups;
		
	}
	
	public String getModel(){
		return this.model;
	
	}
	
	public String getWaterSupply(){
		return this.waterSupply;
	
	}
	
	public int getNumberOfCups(){
		return this.numberOfCups;
	
	}
	
	public String toString() {
		return super.getCode() + "_" + super.getDescription() + "_" + 
				super.getPrice() + "_" + this.getModel() + "_" +
				this.getWaterSupply() + "_" + this.getNumberOfCups();
	
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?