Types in Pictures

Because there’s quite a bit of vocab associated with OOP, it’s worth taking a moment and putting all of it together in a picture. Follow Figure 14.2 while reading the following few paragraphs.

Figure 14.2. Object-oriented concepts for classes and interfaces.

image

The CLR, and hence C#, supports single inheritance for classes and multiple inheritance for interfaces. This means that every class has a single base class (which by default is System.Object, the mother of all types). Alternatively, we could say that a class is a subclass of its base class. Each class can implement zero or more interfaces, which means providing an implementation ...

Get C# 4.0 Unleashed 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.