ambiguity regulation of multiple inheritance with example.
Answer / sahadev tarei
if A class have one function fun().B is a another class
derived from A and it has also one function fun().C is
another function derived from B and also It has one
function Fun().for the role of inheritance C contains 3 fun
().
1. Fun()---inherited from A
2. fun()--- inherited from B
3. fun() -- own C class function
When a user create an object of C and invock to A class Fun
().It wont. tais ambiguti
Example:-
class A
{
public:
void fun()
{
cout<<"A"
}
}
class B:public A
{
public:
void fun()
{
cout<<"B"
}
}
class C:public B
{
public:
void fun()
{
cout<<"C"
}
}
int main()
{
C obj;
obj.fun()---- acess C class function
obj.A::fun();---invock A class function
obj.B::fun();---invocks B class function
return 0;
}
output
C A B
| Is This Answer Correct ? | 5 Yes | 0 No |
What is a null tree?
What is abstraction in oops with example?
Can you name some types of inheritance?
What is persistence in oop?
What is the difference between class and object?
what are three tenets of object orinted Systems?Why they call like that ? Please answer me. Advance thanks.
write a c++ code to overload + and - for a stack class such that + provides push and - provides pop operation
1 Answers College School Exams Tests, HCL, IBM, TCS,
WAP to generate 2n+1 lines of the following pattern on the computer screen:
How to overload new operator in c++
why c++ is called OOPS? waht is inherutance? what is compiler?
explain dynamic binding by drowing
What is polymorphism ? Explain with examples