C++ Programming - Objects and Classes - Discussion

Discussion Forum : Objects and Classes - General Questions (Q.No. 6)
6.
Which of the following statements is correct when a class is inherited publicly?
Public members of the base class become protected members of derived class.
Public members of the base class become private members of derived class.
Private members of the base class become protected members of derived class.
Public members of the base class become public members of derived class.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
2 comments Page 1 of 1.

Iram said:   1 decade ago
Public keyword means data for all, to access data anywhere in the program, so when base class is inherited publicly by the derived class, all public data of base class will be access by derived class.

Gursewak said:   1 decade ago
This is a fact in object oriented programming that we use PUBLIC keyword only and only if we want to access any data anywhere in a program inside any class or outside the class.

Post your comments here:

Your comments will be displayed after verification.