added strategy pattern sample
This commit is contained in:
10
strategy/src/main/java/com/iluwatar/SpellStrategy.java
Normal file
10
strategy/src/main/java/com/iluwatar/SpellStrategy.java
Normal file
@ -0,0 +1,10 @@
|
||||
package com.iluwatar;
|
||||
|
||||
public class SpellStrategy implements DragonSlayingStrategy {
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
System.out.println("You cast the spell of disintegration and the dragon vaporizes in a pile of dust!");
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user