Closed MagnificentCreature closed 9 months ago
Another hypothetical scenario I can think of: abstract class ProgressWatcher could have provided an implementation of the +update(int) method, while the UiWidget just extends the abstract class ProgressWatcher without overriding the +update(int) method in ProgressWatcher.
Now the +update(int) method will be written in ProgressWatcher instead. Hence I think it is necessary to show where there has been an implementation of the +update(int) method.
Extending from my scenario, if the UiWidget overrides the +update(int) method in ProgressWatcher. I think +update(int) method will have to be written in both ProgressWatcher and UiWidget.
Thanks, but without knowing that, would we be penalised if we don't write it for either, or write it for both?
Likewise actually, will we be penalised if we do not write the fields for the classes? Since they are optional also right?
Thanks, but without knowing that, would we be penalised if we don't write it for either, or write it for both?
@MagnificentCreature The code of Activity, Watcher, ProgressWatcher are given in the question. So, some things are known already.
I see, because we know that ProgressWatcher DID NOT override it, so we know UiWidget must override it?
I see, because we know that ProgressWatcher DID NOT override it, so we know UiWidget must override it?
@MagnificentCreature Yes, that's the idea.
Thank you
We already know it inherits from the abstract interface