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, ...