⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 coffeebrewer.java

📁 ssd3 java程序练习 exercise 3 绝对没有问题
💻 JAVA
字号:
import com.sun.org.apache.regexp.internal.recompile;


public class CoffeeBrewer extends Product {
	private String model; //The model of the coffee brewer 
	private String waterSupply; //The water supply (Pour-over or Automatic) 
	private int numberOfCups; //The capacity of the coffee brewer 
	
	public CoffeeBrewer(){}
	
	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;
	}//. Returns the value of instance variable model. 
	
	public String getWaterSupply(){
		return this.waterSupply;
	}//. Returns the value of instance variable waterSupply. 
	
	public int getNumberOfCups(){
		return this.numberOfCups;
	}//. Returns the value of instance variable numberOfCups. 
	
	public String toString(){
		return super.toString()+"_"+getModel()+"_"+
		getWaterSupply()+"_"+getNumberOfCups();
	}
}

⌨️ 快捷键说明

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