What do you mean by inheritance?

Inheritance is the process of creating new classes, called derived classes, from existing classes or base classes. The derived class inherits all the capabilities of the base class, but can add embellishments and refinements of its own.  

Showing Answers 1 - 21 of 21 Answers

vishnu bobade

  • Sep 8th, 2005
 

Inheritance in C++ 
Recall that inheritance is a means of specifying hierarchical relationships between types 
 
C++ classes? can inherit both data and function members?? from other (parent) classes? 
 
In addition, they inherit the "is a" relationship so that an object of a class? SortedList (which inherits from class? List) can be treated as an object of class? List in most cases 
 
Terminology: "the child (or derived) class? inherits (or is derived from) the parent (or base) class?." 

  Was this answer useful?  Yes

v.chandrusekar

  • Jan 17th, 2006
 

Inheritance is the property by which one class can acquire the properties of objects of another class..

supriya

  • Sep 10th, 2011
 

Inheritance can be described as the procee of creating new class from an existing class.
New class is called derived class and existing class is called base class.

  Was this answer useful?  Yes

Inheritance means the property of acquiring base class properties to an other class which is known as the derived class.The syntax for inheriting a class is: class

derived_class_name :
base_class_name , where access specifier denotes either public or protected.Even if you give private as the access specifier it only takes protected as the access specifier.The main advantage of inheritance is re-usability of code.Example consider a class defined for employees in a company in which the fields

name,date_of_birth,address,.. will be same for all the employees whereas depending upon their job title, some of the fields can change so if you want to program it out,

Code
  1. class employees //base class

  2. {

  3. protected:

  4. general_information()

  5. {

  6. get name;

  7. get employee_id;

  8. get address;

  9. }

  10. public:

  11. ....

  12. ....

  13. };

  14. class manager:protected employees //inherited class

  15. {

  16. ...

  17. general_information();

  18. ...

  19. }

  20. class accountant //inherited class

  21. {

  22. ....

  23. general_information();

  24. ....

  25. }

  Was this answer useful?  Yes

pooja sahu

  • Feb 6th, 2012
 

Inheritance is a process to exess the property of exiting class which called base class and then create a new class is derived class. There are mainly 3 types.

1. Single inheritance
2. Multilevel inheritance
3. Multiple inheritance

  Was this answer useful?  Yes

PaulSingh

  • Feb 7th, 2012
 

Inheritance is the ability of once class to inherit the functionality of the base class and specialise it. Typically the relationship between the derived class and the base class is an "IsA" relationship. For example, a Teacher IsA Employee. The Teacher class is a specialisation of the Employee class.

  Was this answer useful?  Yes

shylu

  • Jun 22nd, 2012
 

It is a process that one class can acquires the properties of another base class

  Was this answer useful?  Yes

anamika

  • Jun 14th, 2016
 

Multiple Inheritance is not used in Java

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions