package Strategy; // interfaces, with strategy public class StrategyHarness { public static void main(String[] args) { Fighter f = new Bee(); f.attack(); f.defend(); f.prepareForFight(); // defender version f = new Ninja(); f.attack(); f.defend(); f.prepareForFight(); // override version FlyingThing [] flyers = new FlyingThing[] { new Albatross(), new Canary(), new Penguin(), new Pterodactyl() }; // each one flies using a strategy for (FlyingThing ff : flyers){ ff.fly(10, "North"); } } }