added template method sample

This commit is contained in:
Ilkka Seppala
2014-08-23 13:37:42 +03:00
parent 6157f22ea4
commit 23e2faeca2
7 changed files with 111 additions and 0 deletions

View File

@ -0,0 +1,18 @@
package com.iluwatar;
public class HalflingThief {
private StealingMethod method;
public HalflingThief(StealingMethod method) {
this.method = method;
}
public void steal() {
method.steal();
}
public void changeMethod(StealingMethod method) {
this.method = method;
}
}