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

what is difference b/w object based and object oriented programming language?

18 Answers   Chaitanya, College School Exams Tests, Educomp, IBM, Infosys, Telko,


What is a scope operator and tell me its functionality?

3 Answers   emc2,


to remove the repeated numbers from the given . i.e.., if the input is 12233 output should of 123

2 Answers  


explain sub-type and sub class? atleast u have differ it into 4 points?

0 Answers   Infosys,


what is the diffrence between c# and c++

5 Answers  


Program to check whether a word starts with a capital letter or not.

1 Answers   Infosys,


How would you stop a class from class from being derived or inherited.

18 Answers   Ness Technologies,


How to improve object oriented design skills?

0 Answers  


What is the difference between XML Web Services using ASMX and .NET Remoting using SOAP?

1 Answers  


What do you mean by Encapsulation?

0 Answers   Ittiam Systems,


what is the 3 types of system development life cycle

1 Answers  


Why a "operator=(...)" when there is a copy ctor?

2 Answers  


Categories