English
Summary
Conclusions
An abstract class combines shared state with extension points, an interface defines a role, and nested classes localize helper implementations. Reliability depends on a clear contract: comparison order, iteration completion, and the independence of the completed result.
Self-check questions
- Why does an abstract class need a constructor?
- Which interface members are implicitly public?
- How does default differ from static?
- How do you resolve a conflict between two default methods?
- When do you need an abstract class instead of an interface?
- Why should you avoid implementing compareTo with subtraction?
- What should next do after iteration ends?
- What reference does an inner class have that a static nested class does not?
- What does effectively final mean?
- How does an interface let you replace a strategy?