In Brief

This chapter looked at the important OOP topic of inheritance, the process of deriving one class from another. Although inheritance is familiar to OOP programmers, C# has its own takes on it. For example, structs are value types in C#, so they don't support inheritance. Here is an overview of the topics we discussed:

  • There are various access modifiers available for protecting the members of a class or struct; the default access is private. We can create new members with the new keyword, hiding the members with the same signature in the base class. We can also reach the hidden members using the base keyword. And we can use virtual methods designed to be overridden with the override keyword.

  • C# lets you create both abstract classes, whereby ...

Get Microsoft® Visual C#® .NET 2003 Kick Start now with the O’Reilly learning platform.

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