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’s the difference between callable and runnable?

1032


Explain OOPs concept.

1047


What is another word for methodology?

975


What is a numeric string?

968


How do you format in java?

954


What is sorting in java?

940


what is the swingutilities.invokelater(runnable) method for? : Java thread

995


What is the technique adopted to create an immutable class?

1045


How list contains works in java?

934


How is a variable stored in memory?

943


describe synchronization in respect to multithreading? : Java thread

883


What does bitwise or mean?

1039


How many bytes is string in java?

1160


What is parsing a string?

1099


What is == in java?

967