public abstract class Duck extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) FlyBehavior |
flyBehavior |
(package private) QuackBehavior |
quackBehavior |
Constructor and Description |
---|
Duck() |
Modifier and Type | Method and Description |
---|---|
(package private) abstract void |
display() |
void |
performFly() |
void |
performQuack() |
void |
setFlyBehavior(FlyBehavior fb) |
void |
setQuackBehavior(QuackBehavior qb) |
void |
swim() |
FlyBehavior flyBehavior
QuackBehavior quackBehavior
public Duck()
public void setFlyBehavior(FlyBehavior fb)
public void setQuackBehavior(QuackBehavior qb)
abstract void display()
public void performFly()
public void performQuack()
public void swim()