Access specifiers: “public”, “protected”, “private”, nothing?
In the case of Public, Private and Protected, that is used to describe which programs can access that class or method:
public : any other class from any package can instantiate and execute the classes and methods.
protected : only subclasses and classes inside of the package can access the classes and methods.
private : the original class is the only class allowed to executed the methods.
Recent Comments