English
Summary
Conclusions
Inheritance defines a subtype and shared contract, polymorphism selects an instance implementation based on the object, and composition hides helpers behind a narrow API. A correct hierarchy requires not only extends, but also consistent invariants, constructors, and equality rules.
Self-check questions
- Are constructors inherited?
- When is an explicit super with parameters needed?
- Why should you not call an overridable method in a constructor?
- How does protected work between packages?
- What does the Override annotation check?
- How does static hiding differ from overriding?
- Which type determines an instance method's implementation?
- Why is instanceof safer than an unchecked cast?
- What is the relationship between equals and hashCode?
- When does composition express a contract better?