提交 94b28980 编写于 作者: I Ilkka Seppala

Comments for the strategy example.

上级 4debc8ed
package com.iluwatar;
/**
*
* Strategy (DragonSlayingStrategy) encapsulates the algorithm to use.
* The object (DragonSlayer) can alter its behavior by changing its strategy.
*
*/
public class App
{
public static void main( String[] args )
......
package com.iluwatar;
/**
*
* DragonSlayer uses different strategies to slay the dragon.
*
*/
public class DragonSlayer {
private DragonSlayingStrategy strategy;
......
package com.iluwatar;
/**
*
* Strategy interface.
*
*/
public interface DragonSlayingStrategy {
void execute();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册