23 lines
466 B
Java
Raw Normal View History

2014-08-23 13:37:42 +03:00
package com.iluwatar;
2014-08-31 11:31:03 +03:00
/**
*
* Template Method base class.
*
*/
2014-08-23 13:37:42 +03:00
public abstract class StealingMethod {
protected abstract String pickTarget();
protected abstract void confuseTarget(String target);
protected abstract void stealTheItem(String target);
public void steal() {
String target = pickTarget();
System.out.println("The target has been chosen as " + target + ".");
confuseTarget(target);
stealTheItem(target);
}
}