From the course: Programming Foundations: Object-Oriented Design

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Polymorphism

Polymorphism - Python Tutorial

From the course: Programming Foundations: Object-Oriented Design

Start my 1-month free trial

Polymorphism

- Our fourth and final object-oriented concept is polymorphism which is a complicated sounding word that simply means having many forms. And appropriately enough, there are multiple forms of polymorphism. One form, called dynamic or run-time polymorphism, allows us to access methods using the same interface on different types of objects that may implement those methods in different ways. Think of this basic coffee maker as a class with a method to brew coffee. The input parameters for that brew method are a scoop of ground coffee beans and water. I wait a bit for it to brew and the output is a fresh cup of hot coffee. - I prefer to use a different type of coffee maker. A French press. My French press also has a brew method with the exact same inputs and outputs as Baron's basic coffee maker. I input a scoop of ground coffee and some water. Then after a little while, I press down the plunger and the output is a fresh cup of…

Contents