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
what is ststic with example
What are the main uses of this keyword?
How do you read and print a string in java?
Explain covariant method overriding in java.
Can we overload destructor in java?
What is the difference between public, private, protected, and friend access?
Is null a string in java?
What is the difference between overriding & overloading?
placement papaers of spring computing technology
Can classes declared using the abstract keyword cab be instantiated?
Are true and false keywords?
Is integer a class?
What do you mean by local class?
What does g mean in regex?
Is main a function?