GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  OOPS
Go To First  |  Previous Question  |  Next Question 
 OOPS  |  Question 189 of 255    Print  
Does c++ support multilevel and multiple inheritance?

  
Total Answers and Comments: 2 Last Update: January 20, 2006   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
December 09, 2005 11:03:20   #1  
sahu Member Since: December 2005   Contribution: 324    

RE: Does c++ support multilevel and multiple inherita...

ans:

yes, we can.


 
Is this answer useful? Yes | No
January 20, 2006 07:02:27   #2  
samiksc Member Since: October 2005   Contribution: 233    

RE: Does c++ support multilevel and multiple inherita...

Yes,

In C++ we can derive a class C from B which is derived from A -- multilevel inheritance.

In C++ we can derive a class D from two base classes A and B -- multiple inheritance. This may cause a problem in case A and B are derived from a single base class say P. When a D's method refers to a public/protected data member of P (the uppermost parent) there are two paths available -- A::var or B::var -- here the compiler gives an error. To avoid this problem A and B need to be 'virtually' derived from P. If they are virtually derived then only one copy of P's data members exist for both A and B objects.


 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : pass multiple variables to the function as formal parameters ... function will actually set those values (output variables). ...

Latest Answer : Whenever u want to derieve a class having multiple ancestors or base calsses u have use Multiple InheritanceIt can be done as followsclass A{- - - };class B{---};class C:public A,public B{---}; ...

Latest Answer : The process of creating new classes, called derived classes, from existing classes, called base classes. The derived classes inherit all the capabilities of the base class and also can add new features of its own. ...

Latest Answer : Inheritance is using a generalized class to derive a more specific functionality without re-writing the existing basic functionality code.A base class or parent class contains generalized functions. A derived class reuses the base class functions and ...

Latest Answer : Multiple inheritance refers to a class being derived from two or more classes.Multilevel inheritance refers to a class inheriting from a parent class which is itself derived from another class.Multilevel inheritance is supported by all OOPs languages. ...

Latest Answer : Yes, In C++ we can derive a class C from B which is derived from A -- multilevel inheritance.In C++ we can derive a class D from two base classes A and B -- multiple inheritance. This may cause a problem in case A and B are derived from a single base ...

Latest Answer : Inheritance offers the following advantages --Developement model closer to real life object model with hierarchical relationshipsReusability -- facility to use public methods of base class without rewriting the sameExtensibility -- extending the base ...

Latest Answer : Java supports four types of inheritance1) Single Inheritance2) Multi Level Inheritance3) Hierarchical Inheritance4) Hybrid Inheritance ...


 Sponsored Links

 
Related Articles

ODP.NET - Retrieving Multiple Rows on to the Grid

ODP NET Retrieving Multiple Rows on to the Grid In the previous section we tried to retrieve only one row using OracleDataReader In this section we will try to retrieve more than one row or a result set and populate a DataGridView on a WinForm mosgoogle The following code lists out the details of al
 

Microsoft AJAX Library - Inheritance using Prototypes

Inheritance using Prototypes Once again prototyping can help us implement an OOP feature in a more elegant way than when using closures Prototype based inheritance makes use of the behavior of JavaScript prototypes When accessing a member of a function that member will be looked for in the function
 

Microsoft AJAX Library - Inheritance using Closures

Inheritance using Closures and Prototypes There are two significant techniques for implementing the OOP concept of inheritance with JavaScript code The first technique uses closures and the other technique makes use of a feature of the language named prototyping Early implementations of the Microsof
 

OOPS Tutorials

Object oriented programming OOP is a computer science term used to characterize a programming language that began development in the 1960’ s The term object oriented programming’ was originally coined by Xerox PARC to designate a computer application that describes the methodol
 

ERP Systems as Quality Control Support

ERP Systems as Quality Control Support For the past few years ERP systems have became one of the most powerful tools for quality control management But ERP is just an informatics system that provides support to the integrated business management mosgoogle center Goals of the Quality Control Module i
 

C++ Inheritance

C Inheritance Introduction What is Inheritance Inheritance is the process by which new classes called derived classes are created from existing classes called base classes The derived classes have all the features of the base class and the programmer can choose to add new features specific to the ne
 

Multiple Virtual Storage (MVS)

Multiple Virtual Storage MVS First let us start with an insight to the topic Multiple Virtual Storage MVS stands for Multiple Virtual Storage and this is the technology used mainly with IBM mainframe systems MVS origin is interesting to know The first developed technology was MVT which stands for Mu
 

The Importance of Inheritance Within OOP

The Importance of Inheritance Within OOP In an object oriented programming language that is well designed a function should be able to have functions that reside inside it In addition to this other functions should be processed as input and output as well When an OOP language uses these features it
 

The Inheritance Concept In OOPs

The Inheritance Concept In OOPs In object oriented programming objects will be characterised by classes It is possible to learn a lot about an object based on the class it belongs to Even if you are not familiar with the name Maybach If I told you it is a car you would immediately know that it has f
 

Understanding The Message Concept In OOPs

Understanding The Message Concept In OOPs To understand object oriented programming you will need to become familiar with messages As the name implies a message is a process in which software objects will communicate with one another Because of this having one object is not enough mosgoogle An objec
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape