26 Access Modifiers in Java with Example

preview_player
Показать описание
Access Modifiers in Java with Example

- Public: Access level of public modifier is everywhere which means it can be accessed from class, outside the class within the same package and outside of the package.
- Private: Access level of private modifier is only within the class.
- Protected: Access level of protected modifier is within the package and outside the package using inheritance/sub class.

- Default: Access level of default modifier is only within the package. If you do not specify any modifier then it will be a default modifier.
Рекомендации по теме
join shbcf.ru