Closed xinyee20 closed 3 years ago
1. How does one derive that the level of access is package private from the information given in the question? (I can't seem to infer it from any part of the question)
Activity#getInstance()
and ProgressWatcher.MAX
has no public/private/protected prefixes, which in Java means it is default visibility (i.e. package-private).
2. Should ProgressWatcher have an update(int) method too since it implements the interface Watcher?
I think it's not compulsory? Because an abstract class implementing the interface without implementing update(int)
can already be inferred to have it as an abstract method.
@StopTakingAllTheNames 's answer is correct.
Plus, the ProgressWatcher code is given, and it confirms that it doesn't have that method.
Ahh I see, thankyou:) @StopTakingAllTheNames @damithc
1) How does one derive that the level of access is package private from the information given in the question? (I can't seem to infer it from any part of the question) 2) Should ProgressWatcher have an update(int) method too since it implements the interface Watcher?