пятница, 12 февраля 2016 г.

Java access modificators

Lets lets about access using trusted source- Oracle documentation

A class may be declared with the modifier public, in which case that class is visible to all classes everywhere.

If a class has no modifier (the default, also known as package-private), it is visible only within its own package

The private modifier specifies that the member can only be accessed in its own class.

The protected modifier specifies that the member can only be accessed within its own package (as with package-private) and, in addition, by a subclass of its class in another package

Access Levels
ModifierClassPackageSubclassWorld
publicYYYY
protectedYYYN
no modifierYYNN
privateYNNN



.

Комментариев нет:

Отправить комментарий