© Vaskaran Sarcar 2018
Vaskaran SarcarInteractive C#https://doi.org/10.1007/978-1-4842-3339-9_4

4. Get Familiar with Polymorphism

Vaskaran Sarcar
(1)
560066 Bangalore, Karnataka, India
 
Teacher starts the discussion: Let’s recollect what we discussed about polymorphism in the beginning of this book. Polymorphism is generally associated with one name with many forms; for example, if we have two integer operands with the addition operation, we expect to get a sum of the integers, but if the operands are two strings, we expect to get a concatenated string. I also mentioned that polymorphism can be of two types: compile-time polymorphism and runtime polymorphism .
Here we will start our discussion with compile-time polymorphism.
In compile-time polymorphism, ...

Get Interactive C#: Fundamentals, Core Concepts and Patterns 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.