public class QuackCounter extends java.lang.Object implements Quackable
Modifier and Type | Field and Description |
---|---|
(package private) Quackable |
duck |
(package private) static int |
numberOfQuacks |
Constructor and Description |
---|
QuackCounter(Quackable duck) |
Modifier and Type | Method and Description |
---|---|
static int |
getQuacks() |
void |
notifyObservers() |
void |
quack() |
void |
registerObserver(Observer observer) |
java.lang.String |
toString() |
static int numberOfQuacks
public QuackCounter(Quackable duck)
public static int getQuacks()
public void registerObserver(Observer observer)
registerObserver
in interface QuackObservable
public void notifyObservers()
notifyObservers
in interface QuackObservable
public java.lang.String toString()
toString
in class java.lang.Object