Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


ambiguity regulation of multiple inheritance with example.



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

Post New Answer

More OOPS Interview Questions

Which is the best institute in hyderabad for C/C++ and it also has fast track course structure.

13 Answers   Wipro,


What is property in oops?

0 Answers  


Why do we use inheritance?

0 Answers  


What are the fields of vtable

1 Answers   Mphasis,


Write a program to multiply 3x3 matrics

1 Answers  


what is virtual destructor

7 Answers   L&T, TCS,


can we make a class static without using static keyword?

5 Answers   Aspire,


What is the purpose of polymorphism?

0 Answers  


How to improve object oriented design skills?

0 Answers  


Tell me the scenario,Where we can use interfaces or Abstract class.And What is the difference between interfaces and abstract class?

5 Answers  


Why and when is a virtual destructor needed?

5 Answers  


• What are the desirable attributes for memory managment?

0 Answers  


Categories