Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



What are the advantages of Inheritance?

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 01-02-2010
Member
 
Join Date: Dec 2009
Posts: 68
What are the advantages of Inheritance?
  

Hello Guys,

I am studying the Object Oriented Programming. I want to be aware about the advantages of the inheritance. I know inheritance is the important concept of the object oriented programming. I have searched information regarding advantages of inheritance over various web sites but didn't get proper details. If you have sound knowledge about the inheritance then please let me know it's advantages.

Reply With Quote
  #2  
Old 01-02-2010
Member
 
Join Date: Apr 2008
Posts: 2,000
Re: What are the advantages of Inheritance?

In OOP the "inheritance" is used for to implement the re-usability. Inheritance is nothing but a principle specific to OOP, to create a new class from an existing class. It can be represented as a hierarchy of classes, sometimes called tree classes. Some OOP languages allow multiple inheritance, which means they offer the opportunity to inherit a class of two super classes. Thus, this technique allows to group within a single class attributes and methods of several classes.
Reply With Quote
  #3  
Old 01-02-2010
Member
 
Join Date: May 2008
Posts: 2,290
Re: What are the advantages of Inheritance?

The concept of inheritance opens the door to a new kind of programming. Through the concept of inheritance, the object Building will be able to make to one or of descendants. These descendants will all benefit from the characteristics of their ancestor, Namely its fields and methods. However, the descendants retain opportunity to own their own fields and methods. As a child inherits characteristics of parents and develops his own, an object can inherit characteristics of its ancestor.
Reply With Quote
  #4  
Old 01-02-2010
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: What are the advantages of Inheritance?

Hi,

Following are some situation where you need to use the concept of "Inheritance":
  • If you want to reuse the code base classes.
  • If you want to create global changes to derived classes by changing a base class.
  • You must apply the same class and the same methods to different data types.
Reply With Quote
  #5  
Old 01-02-2010
Member
 
Join Date: May 2008
Posts: 2,382
Re: What are the advantages of Inheritance?

This process of inheritance can be repeated. In other words, it is quite possible to declare this a descendant of House, Developing specialization: a Chalet or a Villa. But equally, there is no theoretical restrictions on the number of offspring for an object. So, why not not declare objects Building or Plant whose common ancestor is always Building. The objects of an inheritance hierarchy comprises their base class because they inherit the properties, fields methods defined in the base class.
Reply With Quote
  #6  
Old 01-02-2010
Member
 
Join Date: Feb 2008
Posts: 1,845
Re: What are the advantages of Inheritance?

The "Inheritance" is used to make the " hierarchy of classes". it is also referred as "Class Tree". The tree of class basically start the a general class called super class or parent class, ancestor class or super class. The genealogical metaphors are many). Then the derived classes (subclass or subclass) have become increasingly specialized. Thus, we can generally express the relation which binds a subclass to its mother by the sentence "is a".
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "What are the advantages of Inheritance?"
Thread Thread Starter Forum Replies Last Post
What is the difference between Single inheritance and multilevel inheritance? Venugopala Software Development 3 08-01-2011 05:32 AM
Prevent inheritance in C # kALAMATHI Software Development 5 04-01-2011 06:11 PM
What is an Inheritance in C#? - Empty Shell - Software Development 4 09-02-2010 06:03 AM
Polymorphism VS Inheritance Taylor D Software Development 5 22-01-2010 09:12 AM
Genericity and Inheritance Ricky58 Software Development 4 30-10-2009 11:41 PM


All times are GMT +5.5. The time now is 05:34 PM.