Tuesday, November 2, 2010

MiniDuckSimulator.java


import java.io.Console;

/**
 * @author mlutfi
 *
 */
public class MiniDuckSimulator {

 /**
  * @param args
  */
 public static void main(String[] args) {
  // TODO Auto-generated method stub
  Duck mallard = new MallardDuck();
  mallard.display();
  mallard.performQuack();
  mallard.performFly();
  
  Duck model = new ModelDuck();
  model.display();
  model.performFly();
  model.setFlyBehavior(new FlyRocketPowered());
  model.performFly();
 }
}

No comments:

Post a Comment