C++ Programming - OOPS Concepts - Discussion

Discussion Forum : OOPS Concepts - General Questions (Q.No. 38)
38.
What happens if the base and derived class contains definition of a function with same prototype?
Compiler reports an error on compilation.
Only base class function will get called irrespective of object.
Only derived class function will get called irrespective of object.
Base class object will call base class function and derived class object will call derived class function.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
22 comments Page 3 of 3.

Sona said:   1 decade ago
The answer given is right as it totally depends on calling class object.

Dhanesh ful said:   1 decade ago
This example of method overrding only the the method of derived class is call istead of base class.


Post your comments here:

Your comments will be displayed after verification.