Explain the concept of polymorphism with examples?
Answers were Sorted based on User's Feedback
Answer / dhawal
polymorphisum-polymorphisum means one name many
forms,basically polymorphisum is base class pointer which
can access derive class members
real time example:-
on street signal if red signal turn on all type of vehicals
are stops means on single action multiple tasks are done.
compile time polymorphisum-overloading.
run time polymorphisum-overriding.
Is This Answer Correct ? | 16 Yes | 0 No |
Answer / venkat
Polymorphism means If one thing exists in different forms v
can it as pOlymorphism
EX:Overloading
Overriding
Is This Answer Correct ? | 14 Yes | 7 No |
Answer / ravikiran(aptech mumbai)
polymorphism is utilizing the same interface for multiple
purposes
ex:-overloading,overriding
Is This Answer Correct ? | 7 Yes | 2 No |
Answer / nazim virani
Polymorphism is accomplished when different component or
classes behave differently on same interface
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / sankar
polymorphism helps us create classes which are simple and
user friendly.it allow the class to behave polymorphicly
when different inputs are passed on to it.
Is This Answer Correct ? | 6 Yes | 5 No |
Answer / babul mog
Polymorphism: polymorphism means the same interface for multiple purposes,basically it is base class pointer which can access derive class members.
It has two types:
1. compile time polymorphisum: function overloading,function overriding.
2. runtime polymorphism : virtual function.
Is This Answer Correct ? | 2 Yes | 1 No |
Can an abstract class have a constructor?
what are variables in java
What is bifunction in java?
There are 2 classes, 1 LandAnimal and another WaterAnimal. There is another class Animal which wants to have the properties of both LandAnimal and WaterAnimal. How will you design this situation?
Difference between linkedlist and arraylist.
What is the purpose of using java.lang.class class?
What are the advantages of packages in java?
What are accessor methods in java?
What is difference between fileinputstream and filereader in java?
Explain the difference between abstract classes and interfaces in java?
How to print an arraylist in java?
what is recursion in java