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
How does arraylist size increase in java?
What does super keyword do?
What is meant by 'bit masking' in java?
Explain constructors and types of constructors in java.
What is the biggest integer?
Can there be an abstract method without an abstract class?
Can a function return a function?
Is array a class?
Is .net better than java?
What is a cup of java?
What is the exact difference in between Unicast and Multicast object?
Explain about exception propagation?
What is the difference amongst jvm spec, jvm implementation, jvm runtime ?
What is the basic concepts of OOPS?
Which method returns the length of a string?