最讨厌这种基本概念的题,知道都知道,就是说不清楚
Polymorphism is a powerful feature of the objected oriented programming language C++.
It is the ability to use an operator or method in different ways. Polymorphism gives different meanings or functions to the operators or methods.
Polymorphism refers to the ability to call different functions by using only one type of function call.
Example:
Suppose you have various cats like cat, tiger and puma.Since they are all of Felidae biological family, and they all should be able to meow, they can be represented as classes inheriting from Felid
base class and overriding the meow
pure virtual function,
Then generate a based class pointer Felid*, let it point to different drived class objects. Each time even though the "Felidpointer->meow" is called, the operations are different.
话说template算不算呢?