Because interfaces are a special type of inheritance, the notations are similar and can cause some confusion. Earlier we said that a line with an arrowhead represents inheritance. An interface is also represented by a line with an arrowhead—but the arrowhead is connected to a dashed line. This notation indicates the relationship between inheritance and interfaces, but also differentiates them. Take a look at Figure 10.5, which is an abbreviated version of an example in Chapter 8, “Frameworks and Reuse: Designing with Interfaces and Abstract Classes.” The Dog
class inherits from the class Mammal
and implements the interface Nameable
.
52.14.138.41