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 |
Program to check whether a word is in all capital letters
Given two strings like x=?hello? and y=?open?, remove any character from string x which is also used in string y, thus making the result x=?hll?.
if u write a class do u write Assignment operator and copy constructor
What is extreme programming?
What is polymorphism explain its types?
diff between Virtual mathod and abstract method?
what is code for call by value and call by reference?
Can we call a base class method without creating instance?
You have one base class virtual function how will call that function from derived class?
How is class defined?
create a c++ program that will accepts 9 inputs using 3 by 3 array.
What is polymorphism what are the different types of polymorphism?