WAP to find the ambiguities in Multiple Inheritance? How
are they
resolved.(Virtual Functions)




WAP to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtua..

Answer / niraj verma

Multiple Inheritance:-

A class can inherit the attributes of two or more classes.
This is know as multiple inheritance. Multiple inheritance
allows us to combine the features of several existing
classes as a starting point for designing new classes. It is
like a child inheriting the physical features of one parent
and the intelligence of onother.

In Multiple
Inheritance the derived class inherit the properly of more
than one base class.



Example:-
# include<iosteam.h>
# include<conio.h>
Class A
{
Protected:
Int x;
Public:
Void getdata ( )
{
Cout<<”\n Enter any
number”;
Cin>>x;
}
};
Class B
Protected:
Int y;
Public:
Void getadta2 ( )
{
Cout<<”\n Enter any number”;
Cin>>y;
}
};
Class c: public A, public B
{
Private:
M, z;
Public:
Void getdata3 ( )
{
Cout<<”\n Enter
any number”;
Cin>>m;
}
Void calculate ( )
{
Z = x*y+m;
}
Void display (
)
{
Cout <<
“\n Result =”<<z;
}
};
Void main ( )
{
C obj;
Obj. getdata1 ( );
Obj. getdata2 ( );
Obj. getdata3 ( );
Obj. calculate ( );
Obj. display ( );
Getch ( );
}

Is This Answer Correct ?    5 Yes 2 No

Post New Answer

More OOPS Interview Questions

What is data binding?

4 Answers   Ittiam Systems,


which is platform independent device used in computers

2 Answers  


Why is oop better than procedural?

0 Answers  


tel me oops defination in single line

2 Answers  


Difference between new operator and operator new

2 Answers  






What is interface in oop?

0 Answers  


Generally, in all C++ programs, texts are in white colour. Can we change the colour of the text(either input or output or both)? If so, help me out.

1 Answers  


create a c++ program that will accepts 9 inputs using 3 by 3 array.

1 Answers  


What is encapsulation process?

0 Answers  


what is main difference between object oriented object base

2 Answers   Wipro,


What is the real time example of inheritance?

0 Answers  


WHAT IS THE ACTUAL DEFINATION OF OBJECT AND THE CLASS IN ONE SINGLE LINE WHICH THE INTERVIEWER WANT TO LISTEN.

11 Answers  


Categories