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