#understanding classes
4 messages · Page 1 of 1 (latest)
private members can be also accessed by friends
Hey Silvia,
Yes, you're mostly correct
Public members can be accessed from anywhere (as long as you have the object of the class).
Private members, however, can only be accessed inside the same class not from outside, even through an object.
They are usually accessed using public methods (getters/setters) if needed.