Skip to content

Access modifier

Access modifiers are keywords that set how entities (i.e. classes, methods, etc) can be accessed from outside the current scope.

  • public: accessible from anywhere
  • protected: accessible within the same class and subclasses
  • private: accessible only within the same class