Programming Languages C++ Objective
Mar 19, 2013

What happens if the base and derived class contains definition of a function with same prototype?

Choose the correct answer:
A) Compiler reports an error on compilation.
B) Only base class function will get called irrespective of object.
C) Only derived class function will get called irrespective of object.
D) Base class object will call base class function and derived class object will call derived class function.
Detailed Explanation

Option D is the right answer.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback