what is polymorphism with example?types of polymorphism?

Answers were Sorted based on User's Feedback



what is polymorphism with example?types of polymorphism?..

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

what is polymorphism with example?types of polymorphism?..

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

what is polymorphism with example?types of polymorphism?..

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

what is polymorphism with example?types of polymorphism?..

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

what is polymorphism with example?types of polymorphism?..

Answer / sachin

Three types

1) Method Overloading
2) Method Overriding
3) Interface

Is This Answer Correct ?    51 Yes 104 No

Post New Answer

More Core Java Interview Questions

What is the unit of plancks constant?

0 Answers  


Is empty list java?

0 Answers  


Which access specifier can be used with class ?

0 Answers  


what is the difference between cd & dvd ?

30 Answers   Lovely Professional University, Satyam, Sibylsys,


Write a program to reverse array in place?

0 Answers  






If two threads call a static method at the same point of time, what will happen?

3 Answers   KPIT,


what is a thread?

13 Answers   IBM, SunGard,


What is the difference between static binding and dynamic binding?

0 Answers  


What is keyword in oop?

0 Answers  


What is a nullable field?

0 Answers  


Can we use different return types for methods when overridden?

0 Answers  


When would you use a static class?

0 Answers  


Categories