adplus-dvertising
frame-decoration

Question

If data members are private, what can we do to access them from the class object?

a.

Create public member functions to access those data members

b.

Create private member functions to access those data members

c.

Create protected member functions to access those data members

d.

Private data members can never be accessed from outside the class

Answer: (a).Create public member functions to access those data members

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. If data members are private, what can we do to access them from the class object?