Chapter 7. Implementing Interfaces and Inheriting Classes
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 ...
Get C# 7 and .NET Core: Modern Cross-Platform Development - Second Edition 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.