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 implement interfaces, about base and derived classes, how to override a type member, how to use polymorphism, how to create extension methods, and how to cast between classes in an inheritance hierarchy.

This chapter covers the following topics:

  • Implementing interfaces
  • Managing memory with reference and value types
  • Inheriting from classes
  • Casting within inheritance hierarchies
  • Documenting your types
  • Inheriting and extending .NET types

Implementing interfaces

Interfaces are a way of connecting different types together to make new things. Think of them like the studs on top of ...

Get C# 6 and .NET Core 1.0: Modern Cross-Platform Development 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.