Class Members’ Visibility

public: can be accessed by any other code
private: can be accessed only from within the same class.
protected: may be accessed from within the class and from within any class that extends that class.

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.