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

explain the concept of inheritance with an example?

Answer Posted / kkr

Inheritance is the process of creating the classes from existing classes by using 'extends' key word.
It is like IS-A relationship between the classes.

eg : Parent and child relationship. we cal parent class as super class and child class will be subclass.i.e the subclass will have all the members of super class.

Adv : Reusability of the code.i.e productivity will be increase. 

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 an anonymous class in java?

1023


What is contract between hashcode and equal method?

984


What is the difference between class & structure?

1133


How do you sort words in java?

891


How do you convert boolean to boolean?

1088


Is age a discrete variable?

923


What is the instance of an object?

1129


What are the uses of synchronized keyword?

959


What does the “final” keyword mean in front of a variable? A method? A class?

949


How do you control extraneous variables?

867


What’s the difference between unit, integration and functional testing?

1054


Why scanner is used in java?

1018


How can you make a class serializable in java?

946


What is null statement?

951


I have multiple constructors defined in a class. Is it possible to call a constructor from another constructor’s body?

958