what is polymorphism with example?types of polymorphism?
Answers were Sorted based on User's Feedback
Answer / sai
Two Types,namely
1)Compile Time Poly(Say as Method Overloading)
Methods having same name but differ in no. of
Parameters,Return type and order of parameters.
2)Runtime Poly(say as Method Overriding and Dynamic Dispatch)
Subclass methods having the same signature as that
of the super class method.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sss
Polymorphsim means one name many form it is basically two type compile time polymorphsim and run time polymorphsim.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / barkha
Polymorphism means one word having different meaning at
different instances.
There are two types.
1)Method overloading
2)Method overriding
| Is This Answer Correct ? | 25 Yes | 39 No |
Answer / sandeep
It is reacting differently for the same kind of message.
For example,
Consider Parrot,Penguin & tiger
My message is "approach me quickly"
Their different reactions:
Parrot approaches me by " flying"
Penguin approaches me by "swimming"
Tiger approaches me by "running"
Here my message is simply "pproach me quickly"
But different things have been reacted differently.
This is called Polymorphism.
As far as my knowledge is concerned there is only one type
of polymorphism and that is runtime polymorphism.
| Is This Answer Correct ? | 69 Yes | 88 No |
Answer / sachin
Three types
1) Method Overloading
2) Method Overriding
3) Interface
| Is This Answer Correct ? | 51 Yes | 104 No |
Is singleton a bad practice?
what is domain object
Explain about varargs in java?
What is map and hashmap? also tell the difference.
there are some duplicate values in ArrayList, how U'll get that array with out duplicate?
Write a function to find out longest palindrome in a given string?
Is {a, n, d} a palindrome? If you are given a random string, is it a palindrome or not?
What is java used for on a computer?
Explain serialization and deserialization in java?
1.what is the exact difference between applet and frame? 2.Do we use main method in frames?
Explain why wait(), notify() and notifyall() methods are in object class rather than in the reading class?
How we can generate random numbers in java?