Explain multiple inheritance, C/C++ Programming

Multiple Inheritance

Multiple inheritance , as the name suggests , is  deriving a class from more than one class . The derived class inherits all the properties of all its base classes. Consider the following example


class Aclass
 {
    :
    :
 };

class  Bclass
 {
    :
    :
 };

class Cclass : public Aclass , public Bclass
 {

  private :
            :
            :
  public  :

        Cclass(...) : Aclass (...), Bclass(...)
         {
         };
 };


 The class Cclass in the above example is derived from two classes - Aclass and Bclass - thus the first line of its class definition have the name of two classes, both publicly inherited. Like with normal inheritance , constructors have to be explained for initializing the data members of all classes. The constructor in Cclass  calls constructors for base classes. The constructor calls are separated by commas.

Posted Date: 6/28/2013 5:40:18 AM | Location : United States







Related Discussions:- Explain multiple inheritance, Assignment Help, Ask Question on Explain multiple inheritance, Get Answer, Expert's Help, Explain multiple inheritance Discussions

Write discussion on Explain multiple inheritance
Your posts are moderated
Related Questions
There are formal ways of reducing Boolean expressions in order to minimize the logic circuit. The two elementary ways of minimization are using Boolean expressions/De Morgan Theore

Why many companies are switching their current business language to PHP? Where PHP basically used? PHP is rapidly gaining popularity and numerous companies are switching their

C program to show overloading of matrix operator: Write a program for matrix operator overloading. class matrix{                   private :                 int x[

Default Value Functions,  When declaring a function we can specify a default value for each parameter. This value will be used if that parameter is left blank when calling to the f

Design and implement a library system that does the following: ? Takes details of a student/library users: first name, last name, other names, user ID number, and nationality. Th


#question:-program to counts tha no of occurances of the string in the nth padovan string

Precedence and Order of evaluation The languages follow a standard precedence for basic operators. Precedence rules help in deleting ambiguity of the order of operations perfor

Are comments included during compilation stage and placed in EXE file as well? - No, comments encountered by compiler are disregarded. - Their only purpose is ease and guida

how to write c++ code for financial system using class and object