?? amplifier.java
字號:
package headfirst.facade.hometheater;public class Amplifier { String description; Tuner tuner; DvdPlayer dvd; CdPlayer cd; public Amplifier(String description) { this.description = description; } public void on() { System.out.println(description + " on"); } public void off() { System.out.println(description + " off"); } public void setStereoSound() { System.out.println(description + " stereo mode on"); } public void setSurroundSound() { System.out.println(description + " surround sound on (5 speakers, 1 subwoofer)"); } public void setVolume(int level) { System.out.println(description + " setting volume to " + level); } public void setTuner(Tuner tuner) { System.out.println(description + " setting tuner to " + dvd); this.tuner = tuner; } public void setDvd(DvdPlayer dvd) { System.out.println(description + " setting DVD player to " + dvd); this.dvd = dvd; } public void setCd(CdPlayer cd) { System.out.println(description + " setting CD player to " + cd); this.cd = cd; } public String toString() { return description; }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -