What is multiple inheritance?

Answers were Sorted based on User's Feedback



What is multiple inheritance?..

Answer / guest

You can derive a class from any number of base
classes. Deriving a class from more than one direct base
class is called multiple inheritance.

In the following example, classes A, B, and C are
direct base classes for the derived class X:

class A { /* ... */ };
class B { /* ... */ };
class C { /* ... */ };
class X : public A, private B,
public C { /* ... */ };
The following inheritance graph describes the
inheritance relationships of the above example. An arrow
points to the direct base class of the class at the tail of
the arrow:



The order of derivation is relevant only to determine the
order of default initialization by constructors and cleanup
by destructors.

Is This Answer Correct ?    13 Yes 1 No

What is multiple inheritance?..

Answer / senthil.k,arasur

Multiple Inheritance occurs when a class inherits from more
than one parent.

Is This Answer Correct ?    5 Yes 0 No

What is multiple inheritance?..

Answer / jitendra rajurkar

In .Net realm a child class can inherit methods and
properties from only one parent class and that parent class
can be either abstract class or any other class.Also Child
class can inherit methods and properties from multiple
interfaces.

class DerivedClass:AbstractClass,InterafaceA,InterfaceB
{
public void main()
{
DerivedClass obj o = new DerivedClass();
o.MethodfromAbstractclass;
o.MehtodfromInterfaceA;
o.MethodfromInterfaceB;
}
}

Is This Answer Correct ?    2 Yes 0 No

What is multiple inheritance?..

Answer / a h khan

if a class is derived from more than one base class then
inheritance is known as multiple inheritance.

the syntax of multiple inheritance is :-

class D : derivations B1, derivation B2,..........
{
member of class D
}

Is This Answer Correct ?    1 Yes 0 No

What is multiple inheritance?..

Answer / p.madhupriya

one derived(child) class is takes properties from more then
one base(parent) class.

Is This Answer Correct ?    1 Yes 0 No

What is multiple inheritance?..

Answer / vikas patel

when we creat the more inheritance the help of the base
inheritance..the main use of the multiple inheritance for
creat Interface..

ex..

class A
{

}
class B
{

}
class C
inherit A,B

Is This Answer Correct ?    0 Yes 0 No

What is multiple inheritance?..

Answer / jyoti lohani

the parent class behaviour & properties are define in child
class that's call inheritance. if child class inherit more
then one parent class that call multiple inheritance.

EX: class X
{
/* ---*/
}
class y
{
/*----*/
}
class z:x,y

Is This Answer Correct ?    1 Yes 2 No

What is multiple inheritance?..

Answer / mayank kumar

in multiple inheritance there is more than one base class
and one derived class.

Is This Answer Correct ?    1 Yes 2 No

What is multiple inheritance?..

Answer / kaush

when one one class(derived class) inherit from more than one
class(base class) then it is called multiple inheritance.
like as,,
class program
{
class a
{
}
class b
{
}
class c:a,b
{
}
}

but in c# multiple inheritance not allowed.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More OOPS Interview Questions

what are the ways in which a constructors can be called?

0 Answers  


What are the components of marker interface?

0 Answers  


What is multilevel inheritance in oop?

0 Answers  


what is the difference b/w abstract and interface?

2 Answers   Merrill Lynch, Schneider, Scio Healthcare,


how can we design a magic square in c++?or suggest me the basic idea of it.

3 Answers  






What are virtual classes?

0 Answers  


What are the 4 pillars of oop?

0 Answers  


JAVA is FULLY OBJECT ORIENTED PROGRAMING LANGUAGE?

3 Answers  


What is destructor oops?

0 Answers  


Describe the difference between a Thread and a Process?

11 Answers   Siebel Systems,


This program numbers the lines found in a text file. Write a program that reads text from a file and outputs each line preceded by a line number. Print the line number right-adjusted in a field of 3 spaces. Follow the line number with a colon, then one space, then the text of the line. You should get a character at a time and write code to ignore leading blanks on each line. You may assume that the lines are short enough to fit within a line on the screen. Otherwise, allow default printer or screen output behavior if the line is too long (i.e., wrap or truncate). A somewhat harder version determines the number of spaces needed in the field for the line numbers by counting lines before processing the lines of the file. This version of the program should insert a new line after the last complete word that will fit within a 72-character line.

0 Answers  


Can a varargs method be overloaded?

0 Answers  


Categories