What is multiple inheritance? Give Example

Answers were Sorted based on User's Feedback



What is multiple inheritance? Give Example..

Answer / hemanth

When class is derived from more than one base class, it is
called as multiple inheritance.
Class a {
int b;

public:
void fun();
}
Class C {
int d;

public:
void fun();
}
Class d :public a, public c {
int x;

void fun1();
}
----------

Here class d inherits class a and c, hence multiple inheritance.

Is This Answer Correct ?    33 Yes 0 No

What is multiple inheritance? Give Example..

Answer / shree

class one
{
int a;
Public void Add();
}

Class Two
{ int b;
Public void Sub();
}

class Three:class one , class two

{
int c;
Public void Mul();
}

In this last class we inherited first two class that is more than one base class so mulptiple inheritance.

Is This Answer Correct ?    7 Yes 0 No

What is multiple inheritance? Give Example..

Answer / arun

A class is derived from more than one base class, it is
called as multiple inheritance.
Class a {
int b;

public:
void fun();
}
Class C {
int d;

public:
void fun();
}
Class d :public a, public c {
int x;

void fun1();
}
----------

Here class d inherits class a and c, hence multiple inheritance.

Is This Answer Correct ?    0 Yes 0 No

What is multiple inheritance? Give Example..

Answer / sadikhasan,meta

Multiple inheritance means duplicate copy of base class is
derive into child class. which explain by following example.
class A
{
}

class B: public A
{
}

class C:public A
{
}

class D:public B,public C //duplicate data
{
}

Is This Answer Correct ?    1 Yes 1 No

What is multiple inheritance? Give Example..

Answer / palsaniya sadikhasan, meta.

Sorry! Following example is the Multilevel inheritance.
which Post by me.


a class is derived from an existing class in multiple level.
e.g.
class abc
{
int a;
public:
void getdata();
};

class xyz public:abc
{
int b;
public:
void getinput();
}

class pqr public:xyz
{
int c;
public:
void show();
}

Is This Answer Correct ?    0 Yes 1 No

What is multiple inheritance? Give Example..

Answer / palsaniya sadikhasan, meta.

a class is derived from an existing class in multiple level.
e.g.
class abc
{
int a;
public:
void getdata();
};

class xyz public:abc
{
int b;
public:
void getinput();
}

class pqr public:xyz
{
int c;
public:
void show();
}

Is This Answer Correct ?    9 Yes 22 No

Post New Answer

More OOPS Interview Questions

what is code for call by value and call by reference?

1 Answers  


When is an object created and what is its lifetime?

4 Answers   IBM,


why the argument is passed by reference to a copy constructor?example?

2 Answers  


Why static Function is used in C++?

4 Answers   TCS,


What does I oop mean?

0 Answers  






Why and when is a virtual destructor needed?

5 Answers  


What is multiple inheritance ?

17 Answers   Blue Star, C DAC, CDAC, Impetus, Ness Technologies, Softvision Solution,


What is super in oop?

0 Answers  


#include <string.h> #include <stdio.h> #include <stdlib.h> #include <conio.h> void select(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); select(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void select(char *items, int count) { register int a, b, c; int exchange; char t; for(a = 0; a < count-1; ++a) { exchange = 0; c = a; t = items[ a ]; for(b = a + 1; b < count; ++b) { if(items[ b ] < t) { c = b; t = items[ b ]; exchange = 1; } } if(exchange) { items[ c ] = items[ a ]; items[ a ] = t; } } } design an algorithm for Selection Sort

0 Answers  


What is destructor give example?

0 Answers  


what are the realtime excercises in C++?

0 Answers   IBM, Wipro,


how many types of notations are in java

1 Answers   National University of Modern Languages (NUML),


Categories