Polymorphism essentially characterizes the type
of a variable, function or object.
Polymorphism may be due to overloading, parametrized types or inheritance.
extern void print(int); \fbox{overloading}
extern void print(float);
template< class T > class list { ... } \fbox{ templates }
list<int>* alist;
class shape { ... }; \fbox{ inheritance }
class circle : public shape { ... }
shape* s = new circle;
slide: Polymorphic type definitions
Operationally, with regard to objects,
polymorphism amounts to the possibility of hiding different
implementations behind a common interface.
In the case of Smalltalk, a common interface is a sufficient criterion to
define polymorphic objects.
In a typed setting however additional constraints must be met.
The flexibility of object oriented programming languages relies
to a great extent on their support for polymorphism.
The additional advantage of strictly typed object oriented languages
is that they check for type constraints,
thus pairing flexibility to safety.