Attribute | Permitted Access |
---|---|
No access attribute | From methods in any class in the same package |
public | From methods in any class anywhere as long as the class has been declared as public |
private | Accessible only from methods inside the class. No access from outside the class at all. |
protected | From methods in any class in the same package and from any subclass anywhere. |

The next image shows the access allowed between classes in different packages.

No comments:
Post a Comment