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



Write A Program to find the ambiguities in Multiple Inheritance? How are they reso..

Answer / Ranjit Kumar

In C++, when a class derives from more than one base class that have conflicting member functions, it is known as multiple inheritance ambiguity. This ambiguity can be resolved using virtual functions. A pure virtual function (declared with = 0) in the base class must be overridden by derived classes. When an object of the derived class is accessed polymorphically (through a base class pointer or reference), the correct version of the overridden function is called due to the presence of virtual keyword.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

why c++ is a highlevel language

3 Answers   Satyam, Tech Mahindra,


//what is wrong with the programme?? #include<iostream.h> template <class first> class dd { first i; public: void set(); void print(); }; void dd< first>:: set() { cin>>i; } void dd< first>::print() { cout<<"\n"<<i; } void main() { dd <char>g; g.set(); g.print(); }

1 Answers  


Name an advantage of array over linked list?

24 Answers   GML, IBM, Software Solutions,


what is Class in oops with example?

4 Answers   HCL,


what are the ways in which a constructors can be called?

1 Answers  


What is Inheritance, Multiple Inheritance, Shared and Repeatable Inheritance?

4 Answers   Accenture, L&T,


State what is encapsulation and friend function?

1 Answers   BirlaSoft,


What is the example of polymorphism?

1 Answers  


Which language is pure oop?

1 Answers  


Difference ways of Polymorphism?

3 Answers  


What is inheritance in simple words?

1 Answers  


how to write a java program for an output ****0 ***01 **012 *0123 01234

1 Answers  


Categories