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...

can any one tell me when do u go for inheritance and
polymorphism

Answer Posted / ganesh

Inheritance :

If you want to reuse the existing class
characteristics(methods,variables ..) then you will use
inheritance ..


Polymorphism :

If you want a method to respond based on our requirement
then we will use polymorphism ..for example like swapping
two variables is same for all types but if write program
means for different types(int,double,char..) u need to write
different methods but under a common method name..

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does string intern() method do?

1133


What is an example of a conditional statement?

1097


What is the transient keyword?

2340


What is the use of System class?

1216


Explain the purpose of garbage collection in Java?

1076


When will we use them?

1102


Can we serialize static variables in java?

1145


How many bits is a float?

1060


What access modifiers can be used for class ?

1075


What is subsequence of a string?

1151


Explain implementation and how is it different from conversion?

1129


How do you add spaces in java?

1060


Is class is a data type?

1132


What are sets in java?

1001


How do you sort a string in alphabetical order in java?

968