April 2013
Intermediate to advanced
1700 pages
92h 51m
English
The CLR, the C# programming language, as well as other Common Language Infrastructure (CLI) languages support only single inheritance for classes. In other words, only a single base class can be used for any given class. When omitted, that base class is System.Object. In the example shown in Figure 14.6, we try to declare a class Tomato, which is both a Fruit and a Vegetable.
FIGURE 14.6 No multiple-class inheritance allowed.
Note: The Diamond Problem
One of the main reasons for not supporting multiple-class inheritance in the CLR comes from the well-known problems and complexities that arise from multiple inheritance, ...
Read now
Unlock full access