From 690cb11cb83636492e68799af01eacc305852924 Mon Sep 17 00:00:00 2001 From: CyC2018 <1029579233@qq.com> Date: Fri, 16 Mar 2018 21:56:35 +0800 Subject: [PATCH] auto commit --- notes/设计模式.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/notes/设计模式.md b/notes/设计模式.md index 4da4c967..6a4dcba0 100644 --- a/notes/设计模式.md +++ b/notes/设计模式.md @@ -101,8 +101,8 @@ public abstract class Duck { } ``` ```java -public class MallarDuck extends Duck{ - public MallarDuck(){ +public class MallardDuck extends Duck{ + public MallardDuck(){ flyBehavior = new FlyWithWings(); quackBehavior = new Quack(); } @@ -161,11 +161,11 @@ public class Squeak implements QuackBehavior{ ```java public class MiniDuckSimulator { public static void main(String[] args) { - Duck mallarDuck = new MallarDuck(); - mallarDuck.performQuack(); - mallarDuck.performFly(); - mallarDuck.setFlyBehavior(new FlyNoWay()); - mallarDuck.performFly(); + Duck mallardDuck = new MallardDuck(); + mallardDuck.performQuack(); + mallardDuck.performFly(); + mallardDuck.setFlyBehavior(new FlyNoWay()); + mallardDuck.performFly(); } } ```