auto commit

This commit is contained in:
CyC2018 2018-03-16 21:56:35 +08:00
parent aa2f32fc58
commit 690cb11cb8

View File

@ -101,8 +101,8 @@ public abstract class Duck {
} }
``` ```
```java ```java
public class MallarDuck extends Duck{ public class MallardDuck extends Duck{
public MallarDuck(){ public MallardDuck(){
flyBehavior = new FlyWithWings(); flyBehavior = new FlyWithWings();
quackBehavior = new Quack(); quackBehavior = new Quack();
} }
@ -161,11 +161,11 @@ public class Squeak implements QuackBehavior{
```java ```java
public class MiniDuckSimulator { public class MiniDuckSimulator {
public static void main(String[] args) { public static void main(String[] args) {
Duck mallarDuck = new MallarDuck(); Duck mallardDuck = new MallardDuck();
mallarDuck.performQuack(); mallardDuck.performQuack();
mallarDuck.performFly(); mallardDuck.performFly();
mallarDuck.setFlyBehavior(new FlyNoWay()); mallardDuck.setFlyBehavior(new FlyNoWay());
mallarDuck.performFly(); mallardDuck.performFly();
} }
} }
``` ```