Copyright 2024 - BV TallVision IT

Methods and attributes can be made available or hidden using visibility. Public, protected and private is a settings that can be applied to a method or attribute. Attributes can also be bombarded to "readonly", which makes them visible but unchangeable. Public methods are available (visible) from anywhere. Protected methods are only available to the class itself and all sub classes. Private methods are available only to other methods in the same class. 

 So how does this help with anything ? When a method is implemented to do a task that should only be done from another method, the method can become a Private method. Other developers will notice the functionality should not be used. Directly. The developer that designed the class can tell a lot more about the functionality by arranging visibility. Not just for methods, but also for attributes. 

There's much more on visibility here.