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(); } } ```