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 are synchronized blocks in java?

1066


When throw keyword is used?

992


What is an eror in java?

991


Does treeset use compareto?

912


What are encapsulation, inheritance and polymorphism?

946


Can an anonymous class be declared as implementing an interface and extending a class in java programming?

1170


Outline the major features of java.

1034


Can we create an object of static class in java?

972


Can we execute a program without main?

965


Does garbage collection occur in permanent generation space in jvm?

1025


What is the most important feature of java? What is an interface?

955


Can a main method be declared final?

1004


How many bytes is a string?

1084


Can we declare main () method as non static?

919


How is string immutable in java?

994