Chapter 06

Implementing Interfaces and Inheriting Classes

This chapter is about deriving new types from existing ones using object-oriented programming (OOP). You will learn about defining operators and local functions for performing simple actions, delegates and events for exchanging messages between types, implementing interfaces for common functionality, generics, the difference between reference and value types, inheriting from a base class to create a derived class to reuse functionality, overriding a type member, using polymorphism, creating extension methods, and casting between classes in an inheritance hierarchy.

This chapter covers the following topics:

  • Setting up a class library and console application
  • Simplifying methods
  • Raising ...

Get C# 8.0 and .NET Core 3.0 - Modern Cross-Platform Development - Fourth Edition now with the O’Reilly learning platform.

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