■
Source Code
The ObjectOverrides project is located under the Chapter 6 subdirectory.
Summary
This chapter explored the role and details of inheritance and polymorphism. Over these pages you
were introduced to numerous new keywords and tokens to support each of these techniques. For
example, recall that the colon token is used to establish the parent class of a given type. Parent types
are able to define any number of virtual and/or abstract members to establish a polymorphic inter-
face. Derived types override such members using the override keyword.
In addition to building numerous class hierarchies, this chapter also examined how to explic-
itly cast between base and derived types, and wrapped up by diving into the details of the cosmic
parent class in the .NET base class libraries: System.Object.
C H A P T E R 6
Do'stlaringiz bilan baham: |