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

📄 ceilingfan.java

📁 深入浅出设计模式
💻 JAVA
字号:
package headfirst.command.undo;public class CeilingFan {	public static final int HIGH = 3;	public static final int MEDIUM = 2;	public static final int LOW = 1;	public static final int OFF = 0;	String location;	int speed; 	public CeilingFan(String location) {		this.location = location;		speed = OFF;	}  	public void high() {		speed = HIGH;		System.out.println(location + " ceiling fan is on high");	}  	public void medium() {		speed = MEDIUM;		System.out.println(location + " ceiling fan is on medium");	} 	public void low() {		speed = LOW;		System.out.println(location + " ceiling fan is on low");	}  	public void off() {		speed = OFF;		System.out.println(location + " ceiling fan is off");	}  	public int getSpeed() {		return speed;	}}

⌨️ 快捷键说明

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