第1年3月17日 head first 策略模式
作者:互联网
1.
public abstract class Duck { FlyBehavior flyBehavior; QuackBehavior quackBehavior; public abstract void display(); public void performFly(){ flyBehavior.fly(); } public void performQuack(){ quackBehavior.quack(); } public void setFlyBehavior(FlyBehavior fb){ this.flyBehavior = fb; } public void setQuackBehavior(QuackBehavior qb){ this.quackBehavior=qb; } }
https://www.cnblogs.com/znicy/p/5522422.html
https://blog.csdn.net/phapha1996/article/details/52578571
标签:head,17,void,abstract,QuackBehavior,flyBehavior,public,quackBehavior,first 来源: https://www.cnblogs.com/javastart/p/14547141.html