Let’s review what you have already learned about polymorphism. Polymorphism is generally associated with one name with many forms; for example, if you have two integer operands with the addition operation, you expect to get a sum of the integers, but if the operands are two strings, you expect to get a concatenated string. I also mentioned that polymorphism can be of two types: compile-time polymorphism and runtime polymorphism.
Here, I’ll start our discussion with compile-time polymorphism.
In compile-time polymorphism, the compiler can bind the ...