How it works...

Polymorphism is something you will easily be using already by simply applying good object-oriented principles to the design of your classes. With the abstract Shuttle class, we saw that the class took on the shape of the NasaShuttle class and the RoscosmosShuttle class when it was used to derive those new classes from its abstraction. The constructor of the NasaShuttle class was then overridden to provide the same method name, but implemented using different signatures.

This is at the heart of polymorphism. Most likely, you have been using it without knowing about it.

Get C# 7 and .NET Core Cookbook 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.