This chapter is about deriving new types from existing ones using object-oriented programming (OOP). You will learn how to define operators and local functions, delegates and events, implement interfaces about base and derived classes, override a type member, use polymorphism, create extension methods, and cast between classes in an inheritance hierarchy.
This chapter covers the following topics:
Setting up a class library and console application
Simplifying methods with operators
Defining local functions
Raising and handling events
Implementing interfaces
Managing memory with reference and value types
Inheriting from classes
Casting within inheritance hierarchies
Inheriting and extending .NET types