CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS LANGUAGES C++ DETAILS
Question :
What do you mean by inheritance?
Category C++ Interview Questions
Rating (3.9) By 16 users
Added on 10/22/2004
Views 6329
Rate it!
Answers:

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>



 Posted by: k chelladurai    

Contact k chelladurai  Contact k chelladurai

inheriting the properices of base class to new class



 Posted by: kamalakar raju    

Contact kamalakar raju  Contact kamalakar raju

Inheritance is the capability to inherit the the behaviour of other class into another class.



 Posted by: Dilip    

Contact Dilip  Contact Dilip

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>



 Posted by: ajaybob    

Contact ajaybob  Contact ajaybob

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.



 Posted by: Vishal Tikku    

Contact Vishal Tikku  Contact Vishal Tikku

inheritance is the property by which an object inherit the property of other



 Posted by: jaywant topno    

Contact jaywant  topno  Contact jaywant topno

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



 Posted by: Dany    

Contact Dany  Contact Dany

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.



 Posted by: sunita saini    

Contact sunita saini  Contact sunita saini

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



 Posted by: bhanuprakash    

Contact bhanuprakash  Contact bhanuprakash

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>



 Posted by: Deepak Sharma    

Contact Deepak Sharma  Contact Deepak Sharma

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



 Posted by: p.ashwini    

Contact p.ashwini  Contact p.ashwini

Derivation of new classes from existing class to facilitate code reuse is inheritance. It is of 4 types.



 Posted by: himani    

Contact himani  Contact himani


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
What is polymorphism? Explain with an example?
View Answer
What is the difference between an object and a class?
View Answer
What is encapsulation?
View Answer
What is abstraction?
View Answer
What do you mean by binding of data and functions?
View Answer
Difference between realloc() and free()?
View Answer
What is function overloading and operator overloading?
View Answer
What is virtual class and friend class?
View Answer
What do you mean by inline function?
View Answer
What is a template?
View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL C++ Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/952/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.62