Polymorphism is the idea that two related classes can have slightly different implementations for the same method. When using interfaces as types, a developer can define functions that accept any objects that implement the interface as parameters. Then, depending on what object you send to the function, the function will run slightly different code. To use polymorphism:
Tip
|