Compile-time polymorphism versus run-time polymorphism

Before we go further, let me pause for a minute and explain the previous two bullet points on polymorphism.

When we say compile-time polymorphism, we are saying that we will be declaring methods with the same name but with different signatures. Therefore, the same method can perform different functions based on the signature (parameters) it receives. This is also known as early binding, overloading, or static binding.

When we say run-time polymorphism, we are saying that we will be declaring methods with the same name and with the same signature. In a base class, for example, the method is overridden by the method in a derived class. This is achieved by what we call inheritance and by ...

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