Superclass Members
Explore how to access inherited superclass members in D using the super keyword, disambiguate names in inheritance hierarchies, and properly call superclass constructors from subclasses. Understand the role of super in constructors and how subclass constructors manage superclass initialization for seamless object creation.
We'll cover the following...
Accessing superclass members
The super keyword allows referring to members that are inherited from the superclass.
The super keyword is not always necessary; minute alone has the same meaning in the code above (line # 23). The super keyword is needed when both the superclass and the subclass have members under the same names.
If multiple classes in an inheritance tree define a symbol with the same name, one can use the specific name of the class in the inheritance tree to disambiguate between the symbols: