Because the compiler will only allow you to implement an interface.
因为编译器只允许你实现接口。
The downside is that to implement an interface, you must implement all the specified methods.
最后阶段是实现接口,您必须实现所有指定的方法。
Therefore, all our strategies need to do is to implement an interface with one single method - Execute.
因此,我们所有的战略需要做的是实施单一的方法-执行一个接口。
应用推荐