Polymorphism is one of the basic concepts in OOP (Object Oriented Programming). Main idea of the polymorphism is that an object have the ability to take on different forms. To achieve that (polymorphism), we have two main approaches.
Method overloading
Method overriding
Using these two approaches we can use the same method/function to behave differently. Let's see more details on this in following examples.