Part 1 of 6 · 1 min read
Why this page comes third
In this module you will
- Explain an interface as the set of requests an object can answer.
- Tell an object's class from its type.
- State the first principle of reusable design, depend on interfaces and not on concrete classes, and apply it.
- Choose between an interface and an abstract class in Java.
- Use an interface to let two implementations of one idea live side by side.
Module 2 hid the inside of a class. This page shows what is left visible, and why other code should depend on that and nothing else. The sources are "Design Patterns" (GoF), chapter 1, and "Effective Java" (EJ) Item 20. Code was compiled and run before it was written here. Numbers marked "made up" only show the idea.