I just want to make sure I got the idea of public and private right.
Regarding the private access specifier, does it mean:
- Only accessed inside the class
- Cannot be accessed from the object of the class unless there are public class methods that can be used to access them (Can other objects use those public functions?)
- No other object can access them
And for public:
- Accessed from the object of the class
- Accessed from any other object
Is that right?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…