摘要:
最近在看Head First 设计模式,其中命令模式中有讲到实现撤销功能,并且作者还出了一道题,下面的是书中习题:public class MarcoCommand implements Command{ Command[] commands; public MarcoCommand(Command[] commands) { this.commands = commands; } public void execute() { for (int i = 0; i < commands.Length; i++) { commands[i].execute(); } } public... 阅读全文