auto commit
This commit is contained in:
parent
aa2f32fc58
commit
690cb11cb8
|
@ -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();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue
Block a user