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

Why hashmap is used in java?

1089


What is externalizable?

1059


What is the difference between a field variable and a local variable?

1109


What is numeric function?

1006


Is hashset ordered?

1067


How to perform linear search in java?

942


Explain how to force the garbage collection in java.

963


What are the types of web technologies?

1042


Explain the difference between transient and volatile in java?

1002


What are the high-level thread states in java programming?

1053


What does file separator do in java?

1014


What does int [] mean in java?

1030


What is singleton service?

960


Difference between overriding and overloading in java?

1067


Is it necessary for the port addresses to be unique? Explain with reason.

1018