Город МОСКОВСКИЙ
00:08:01

java Access Modifier

Аватар
Кодовые хитрости
Просмотры:
21
Дата загрузки:
05.12.2023 12:06
Длительность:
00:08:01
Категория:
Обучение

Описание

Access Modifiers in Java are used to define access to various classes and objects, functions, and constructors.
It is used to specify the scope of any method, class etc.
The default access modifiers in Java are used to define access when no other modifier is specified for the class or function.
The keyword private is used to define access to method.
It is only accessible in the same class, i.e. any other class of the same package won’t be able to access it.
In public access modifier, there is no restriction, i.e. methods can access from anywhere in the program

Рекомендуемые видео