Question: (update) I was wondering if anyone can help implementing this and its Multicast version You can reuse java.util.Observable and java.util.Observer. For a testing purpose, have
(update)
I was wondering if anyone can help implementing this and its Multicast version

You can reuse java.util.Observable and java.util.Observer.
For a testing purpose, have an observable object randomly change its quote value periodically and notify quote changes to its observers.
[OPTIONAL] Avoid using java.util.Observable and java.util.Observer and implement your own. Use generics to define user-defined Observer and its update() so that you dont have to do downcasting in update().
- observers > Observer Observable addObserver(o: Observer): void setChanged(): void hasChanged():boolean clearChanged: void notifyObservers(): void notifyObservers(arg: Object): void ...update o: Observable, arg: Obiect): void PiechartObserver TableObserver 3DObserver update(...): void update(...): void update(...): void StockQuoteObservable a map of ticker and quote changeQuote(t: String, StockEvent ticker: String uote: float : float): void Update a map with t and q; setChanged); notifyObservers(new QuoteEvent(t, q); (StockEvent) arg, arg.getTicker) and arg.getQuote)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
