Pages

Showing posts with label method overriding. Show all posts
Showing posts with label method overriding. Show all posts

Friday, May 8, 2020

Polymorphism in Java

Index of Polymorphism:

1. What is Polymorphism? Explain with realtime example?
2. How to achieve Polymorphism:
3. What is method overloading. 
4. What is method overriding. 
5. What are Diff. betn method overloading & method overriding. 
6. When to use method overloading in realtime Java Project
7. When to use method overriding in realtime Java Project



1. What is Polymorphism? Explain with realtime example?


Ans --> Different behavior at different instance by using same entity is called as Polymorpohism.

Eg. I am acting as software developer in office and acting as son at home. So here there are my 2 behaviors  software developer and son at 2 different places ie. at Office and home by respectively by using same entity (here I am acting as an entity).
Polymorphism in Java