+ 1
How to access private data of a class?
5 RĂ©ponses
+ 11
Use a getter or setter method đđ€đââïžđ
+ 3
By creating and using public methods that can access the data of that class.
+ 3
Alternatively, for C++, a friend function introduced in class definition can access a class' private members, as if it was a method of the class itself.
+ 1
Thanks.
+ 1
to access private method? to write the key word with you mathod name { set or get }
ste keywords used to assign value.
get keywords used to print/show value.