Accessors

Accessors are instructions that generally give a property of method permission to be accessible in different ways. There are three types:

public: This property or permission is accessible from anywhere in the application.

protected: This property or permission is accessible only from a class that extends the parent class.

private: This property or permission is accessible only within the current class you are working with.

The really neat thing about access is that it protects your code should other developers be working on the same project. If you don’t want them to be able to touch something, don’t give him access to it.

Leave a Reply

Your email address will not be published. Required fields are marked *