Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Difference between association, composition and aggregation?

935


What is method reference in java?

1064


What is the final keyword in java?

1368


Is an integer an object?

910


What purpose do the keywords final, finally, and finalize fulfill?

1055


Define interface in java?

1034


How to display names of all components in a Container?

2895


What is set and get methods in java?

932


What happens if main method is not static?

955


Can we create our own daemon thread?

932


What is the association?

936


What about method local inner classes or local inner classes in java?

1009


Can finally block be used without a catch?

937


Is alive in java?

903


What does java stand for?

1048