English
Topic 7. Abstract classes, interfaces, and nested classes
Goal: learn to design contracts, implement multiple roles, comparison, and iteration, and choose the appropriate kind of nested class.
Lecture contents
- Abstract classes and the template method — A contract without a ready implementation · Example 1. A report template method
- Interfaces and their methods — An interface as an object's role · Default, static, and private · Abstract class or interface
- Comparison and iteration — Example 2. Natural and external ordering · Iterable and Iterator · Example 3. A range with an inner iterator
- Nested classes and standard contracts — Four kinds of nested classes · Example 4. A static order builder · Other standard contracts and strategies · Working in the IDE and testing contracts