tv.java
来自「深入浅出设计模式」· Java 代码 · 共 24 行
JAVA
24 行
package headfirst.command.remote;public class TV { String location; int channel; public TV(String location) { this.location = location; } public void on() { System.out.println("TV is on"); } public void off() { System.out.println("TV is off"); } public void setInputChannel() { this.channel = 3; System.out.println("Channel is set for VCR"); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?