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.

Image

FIGURE 14.2 Object-oriented concepts for classes and interfaces.

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# 5.0 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.