what is polymorphism with example?types of polymorphism?
Answer Posted / ramaraju
polymorphism means "same thing will exists with different
forms"
Ex :suppose we need to find volume of
circle,rectangle,triangle.ect in a sampe program.
genrally what we need to do is write the code volume for
cirle,rectangle,triangle in sepratly.
using polymorphism concept we simply write the volume code
with different parameter list ect
Ex:
class a {
volume(int a)//for rectangle
{
---
}
volume (int a,intb,intc)//for triangle
{
--
}
volume (string s)//for circle
{
--
}
}end of class A
polymorphisam are mainly two types
static polymorphisam(corresponding method will bind at the
time of compiling)
dynamic polymorphisam(corresponding method will bind at the
run time)
| Is This Answer Correct ? | 162 Yes | 18 No |
Post New Answer View All Answers
Explain about features of local inner class?
What is the importance of static variable?
What is the string function?
What does || mean in vectors?
What are measurable parameters?
What is serial version uid and its importance in java?
Why does it take so much time to access an applet having swing components the first time?
How do you delete a list in java?
What is the use of System class?
Can a constructor call another constructor?
What is the difference between menuitem and checkboxmenu item?
What are the advantages and disadvantages of object cloning?
What is sorting in java?
What is the statements?
What is a java object and java application?