Inheritance is the process of creating new classes, called derived classes, from existing classes or<br>base classes. The derived class inherits all the capabilities of the base class, but can add <br>embellishments and refinements of its own.
create new classes from base class is called inheritance <br>
Unlike composition, which involves creating new objects by combining and connecting other objects, inheritance involves creating new objects by directly acquiring the attributes and behaviors of other objects and then extending or specializing them. Like composition, inheritance is everywhere in real life. You inherited your parents genes, and acquired physical attributes from both of them. Technological products (computers, cell phones, etc?) often inherit features from their predecessors. C++ inherited many features from C, the language upon which it is based, and C itself inherited many of its features from the programming languages that came before it. <br><br>Consider an apple and a banana. Although an apple and a banana are different fruits, both have in common that they are fruits. Because apples and bananas are fruits, anything that is true of fruits is also true of apples and bananas. For example, all fruits have a name, a flavor, and are tangible objects. Thus, apples and bananas also have a name, a flavor, and are tangible objects. Apples and bananas inherit these properties from the concept of fruit because they are fruit. Apples and bananas then define some of these properties in different ways (apples and bananas have different flavors), which is what makes them distinct from each other.<br><br><br><br>The object being inherited from is called the parent or base, and the object doing the inheriting is called the child or derived object. In the above picture, ?fruit? is the parent, and both ?apple? and ?banana? are children. Unlike in composition, where each object has a has-a relationship with it?s subobjects, in inheritance, each child has an is-a relationship with it?s parent. An apple is-a fruit. A triangle is-a shape. Red is-a color.<br><br>By default, the children receive all of the properties of the parents. However, the children are then free to define or redefine inherited properties (bananas have that unique banana flavor), add new properties (eg. bananas add the property of being ?starchy?, which is not true of many other fruits), or even hide properties.<br><br>It is possible to define entire hierarchies of objects via inheritance. For example, a square is a rectangle, which is a quadrilateral, which is a shape. A right triangle is a triangle, which is also a shape.<br><br><br><br>
Inheritance is basically the process in which one object acquires the properties of another object.<br>The derived class can have its own properties but it can acquire the properties of the base class by using inheritance.<br>The basic principle lies here is the reusability of code.
Inheritance is one of the concepts of OOP which allows the creation of<br>hierarchical classifications. Using inheritance, you can create a general class that<br>defines traits common to a set of related items. This class may then be inherited by<br>other, more specific classes, each adding only those things that are unique to the<br>inheriting class.<br>In keeping with standard C++ terminology, a class that is inherited is referred to as<br>a base class. The class that does the inheriting is called the derived class.<br>Ref:C++ complete Reference
Inheritance is one of the fundamental mechanisms for code reuse in OOP.It allows new class to be derived from an existing class.New class is called derived class and existing class is known as base class.
1.inheritance is the process of creating new class from an existing class 2. the existing class is called base class and newly created class is called derived class 3.derived class inherits the all the capabilitys of base class and it's own capabilitys
The inheritance means you can derived the property of base class . this will done by : this operator<br><br>examples:<br><br>class base <br>{<br><br>}<br>class derived<br>{<br><br>}<br><br>class base : class derived{} <br>inherit properties of base class <br><br>
inheritance is an featur of oops concept<br>inheritanc means achiving one class qualities to anothe class<br>note:<br>only yhe public and the protected memders can be inherited <br>private members can not be achived by inheritance