Skip to content

Latest commit

 

History

History
9 lines (9 loc) · 631 Bytes

problem_174.md

File metadata and controls

9 lines (9 loc) · 631 Bytes
  • Ad-hoc polymorphism
    • Allow multiple functions that perform an operation on different
    • add(int, int) and add(str, str) would be separately implemented
  • Parametric polymorphism
    • This allows a function to deal with generics, and therefore on any concrete definition of the generic.
    • e.g. A List type in Java, regardless of which objects are in the list
  • Subtype polymorphism
    • This allows subclass instances to be treated by a function they same way as it would superclass instances
    • e.g. Instances of Cat will be operated on a function the same way as instances of it's superclass Animal.