1.

How to overcome diamond problem?(a) Using alias name(b) Using seperate derived class(c) Using virtual keyword with same name function(d) Can’t be doneThe question was asked during a job interview.My query is from Multiple Inheritance topic in portion Inheritance & its Types of Object Oriented Programming

Answer»

Correct choice is (C) Using virtual keyword with same name function

To explain I would say: To overcome the ambiguity and CONFLICT we can use keyword virtual. This will HELP us to differentiate the functions with same name that came to last derived class in DIAMOND PROBLEM.



Discussion

No Comment Found

Related InterviewSolutions