Question: A public data member with the same name is provided in the base and its derived classes. which of the following is true? It is
A public data member with the same name is provided in the base and its derived classes. which of the following is true?
It is a compiler error to provide a field with the same name in both the base and derived classes.
The program will compile, and this feature is called 'overloading'.
The program will compile, and this feature is called 'overriding'.
The program will compile, and this feature is called 'hiding' or 'shadowing'.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
