poly-mor-phic: able to assume different forms
Some functions execute in a way that’s independent of the data type on which they operate. Some data structures are structured in the same way regardless of the types of their elements.
As an example, consider a function to concatenate linked lists in Java. We define a List class, subclasses for empty and nonempty lists, and a (nondestructive) append method:
There’s nothing about the code for the IntList data type or the append method that would be any different if the element type were String or Tree instead of Integer. We might like append to be able to ...