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 is a java list?

1119


Explain the importance of finally over return statement?

1046


Explain the difference between collection api and stream api in java8?

974


what is singleton class in java?

1056


What is null statement?

1017


Explain the difference between protected and default access.

999


What is the difference between a loader and a compiler?

1038


What is tochararray in java?

938


What are the differences between string, stringbuffer and stringbuilder?

1031


Explain about static nested classes in java?

1068


What are class types in java?

1077


What is thread count in java?

1010


What is data type example?

963


Is a method a function?

1063


What is integers and example?

992