What is polymorphism? Explain with an example.
Answers were Sorted based on User's Feedback
Answer / kris_kamatoy
The word “polymorphism” means “different forms”. Applied in
object-oriented
paradigm it means the ability of an entity to exhibit
different forms at runtime.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / sudarsan
polymorphism means is set of different kind of behaviours.
poly means "many" morphism means "form"... example just
imagine a man.. a man behaviour is not same with his wife
and his mother.. he behave differ with his wife.. he may
behave differ with his mother.. so he cannot behave his
mother like his wife...
same function
but
different behavior.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / josh
Polymorphism
Poly means “many” and morph means “form”. In the context of
object-oriented systems, polymorphism means objects that
can take on or assume many different forms. Polymorphism
means that the same operation may behave differently on
different classes.
Polymorphism allows us to write generic, reusable code more
easily, because we can specify general instructions and
delegate the implementation details to the objects
involved. Since no assumption is made about the class of an
object that receives a message, fewer dependencies are
needed in the code and, therefore maintenance is easier.
For example, in a payroll system, manager, office worker,
and production worker objects all will respond to the
compute payroll message, but the actual operations
performed are object specific.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / amit kumar
Poly means “many” and morph means “form”. In the context of
object-oriented systems, it means objects that can take on
or assume many different forms. Polymorphism means that the
same operation may behave differently on different classes.
Polymorphism allows us to write generic, reusable code more
easily, because we can specify general instructions and
delegate the implementation details to the objects involved.
Since no assumption is made about the class of an object
that receives a message, fewer dependencies are needed in
the code and, therefore maintenance is easier. For example,
in a payroll system, manager, office worker, and production
worker objects all will respond to the compute payroll
message, but the actual operations performed are object specific
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / dharmendra rai
The concept of polymorphism can be explained as "one interface, multiple methods".
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / abdul vakeel
beatiful example for polymorphism.....
A boy stat LOVE with the word FRIENDSHIP....and girl ends
her LOVE with same word FRIENDSHIP..in this the word is same
...but attitude is different...this is called polymorpic
behaviour........
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / abdul vakeel
Having the same name but different forms is the polymorphism....
beatiful example for polymorphism.....
A boy start LOVE with the word FRIENDSHIP....and girl ends
her LOVE with same word FRIENDSHIP..in this the word is same
...but attitude is different...this is called polymorpic
behaviour........
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / santosh wavare
Polymorphism is one of the important feature of OOP's. It
consist of 2 words i.e., 'Poly' which stands for many
and 'Morphism' stands for forms.
We can divide the polymorphism into 2 types.
1. Static polymorphism
2. Dynamic polymorphism
Static polymorphism:- In this the binding is taken place in
compile time. The different types of static polymorphism
are:-
a) Function Overloading
b) Operator Overloading
Dynamic polymorphism:- In this the binding that takes place
at run-time. The difference types of dynamic polymorphism
are:-
a) Virtual function
b) Abstract class
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / shiny
The meaning of Polymorphism is something like one name many forms. Polymorphism enables one entity to be used as as general category for different types of actions. The specific action is determined by the exact nature of the situation. The concept of polymorphism can be explained as "one interface, multiple methods".
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / vivek
Ploymorphism is the concept of OOP's. It allows you invoke
derived class methods through base class reference during
runtime.
Is This Answer Correct ? | 2 Yes | 1 No |
Can we call a base class method without creating instance?
IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?
What exactly is polymorphism?
What is difference between function overloading and overriding?
What does the keyword "static" mean?
different types of castings
What are two types of polymorphism?
What is namespace?
Program to open a file with First argument
What are constructors in oop?
What is the highest level of cohesion?
What is protected in oop?