Implementing Inheritance

Inheritance involves a base class and a derived class. The derived class inherits from the base class. With few exceptions, members of the base class are inherited into the derived type. Derived classes can override inherited members and add new members to extend the base class.

Here is the inheritance syntax:

class derivedclass: baseclass, interface1, interface2, ...,  interfacen {
    body
}

In the class header, the inheritance operator (:) indicates inheritance and is followed by the inheritance list. The inheritance list is a comma-delimited list that includes a maximum of one base class and any number of interfaces. Classes are limited to inheriting a single class. However, a class can implement multiple interfaces. C++ developers ...

Get Programming Microsoft® Visual C#® 2008: The Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.