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

How many bytes is double?

1048


What is the difference between array and array list in java?

1302


How do you invoke a method?

1050


what is bmg file and how to create that files?what will it contailn?

2396


How to set the permissions to a file in java?

1045


What is the benefit of using enum to declare a constant?

1172


How do you take thread dump in java?

1058


How do you reverse sort in java?

1002


Implement 2 stacks with just 1 array. The stack routines must not indicate overflow unless every slot in array is used.

1373


Why are the objects immutable in java?

1053


Why set is used in java?

1067


Explain how can you debug the Java code?

1117


What are synchronized methods ?

1157


How do you decide when to use arraylist and linkedlist?

1049


What is static synchronization?

1162