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

📄 hottub.java

📁 Head first design pattern这本经典书的 源码
💻 JAVA
字号:
package headfirst.command.remote;public class Hottub {	boolean on;	int temperature;	public Hottub() {	}	public void on() {		on = true;	}	public void off() {		on = false;	}	public void bubblesOn() {		if (on) {			System.out.println("Hottub is bubbling!");		}	}	public void bubblesOff() {		if (on) {			System.out.println("Hottub is not bubbling");		}	}	public void jetsOn() {		if (on) {			System.out.println("Hottub jets are on");		}	}	public void jetsOff() {		if (on) {			System.out.println("Hottub jets are off");		}	}	public void setTemperature(int temperature) {		this.temperature = temperature;	}	public void heat() {		temperature = 105;		System.out.println("Hottub is heating to a steaming 105 degrees");	}	public void cool() {		temperature = 98;		System.out.println("Hottub is cooling to 98 degrees");	}}

⌨️ 快捷键说明

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