Добавить в "Избранное" Вам нужно авторизоваться. Забыли пароль? Регистрация Май вт. 21 2024 г. в 2:11
Навигация
Поиск
Рассылка



Отписаться
Статистика

Экспорт новостей

rss2.0

Форум

Ответов: 0       Страницы: 1
Автор Сообщение
Gurpreetsingh023
Новенький

Создано
тем: 3,
ответов: 1

Откуда:Берегово
What are the access specifiers in Java? List them.
Access specifiers in Java are keywords that define the visibility or accessibility of variables, classes, methods and other Objects within a Java application. In Java, there are four access specifiers: public, protected (also called package-private), default, and private. Java Course in Pune

The public is the most permissive. If a class or method is declared public, then it can be accessed by any class within the package, or any package. All classes can see and access public members.

The protected specifier restricts the access to members and subclasses of the same package (regardless package). The protected members are accessible by all subclasses of the class that declares them, and by classes within the same package. This specifier can be used to control access to members of a class within a hierarchy.

The default is also known as package private. It is the absence an access specifier. If a class or method is declared with no access specifiers, then it can only be accessed within the package. Classes, methods or variables that have default access will not be visible to any classes outside of the package where they were declared.

The private is the most restrictive access specifier. If a class member has been declared private, then it can only be accessed from the class that it was declared in. Private members cannot be accessed from another class or subclass. This specifier can be used to hide implementation details and enforce encapsulation within a class. Java Classes in Pune

These access specifiers enable Java developers to control visibility and accessibility in their code. This promotes encapsulation and inFormation hiding as well as modularity which are all fundamental principles of Object oriented programming. Developers can create robust classes and APIs by carefully Selecting the right access specifiers for each member of the class.



Тема Создана: 30.04.2024 12:09:33
Профайл E-mail Письмо  
Ответов: 0       Страницы: 1
Ваш E-Mail:
Текст ответа:
Цвет: Размер: Закрыть таги

Very Happy Smile Sad SurprisedShocked Confused Cool LaughingMad Razz Embarassed Crying or Very sadEvil or Very Mad Twisted Evil Rolling Eyes WinkExclamation Question Idea Arrow
Вы хотите получать уведомления по e-mail
о новых сообщениях в этой теме?:
Yes No
* Введите указанное на картинке 6 значное число
Это сделано для предотвращения регистрации роботами
 
  

новых тем на форуме

Можно: Удалять все баннера и статьи и эту строку в том числе, все установлено как пример. Нельзя: Убирать любым способом строку с копирайтом "Работает под управлением WebCodePortalSystem", для снятия надписи нужно преобрести другую лицензию. Зайдите на сайты: Оффициальный сайт и на Сайт разработчика и сделайте запись в гостевой с вашим мнением о CMS.
Вход
Логин:

Пароль:


Запомнить меня
Вам нужно авторизоваться.
Забыли пароль?
Регистрация
На сайте
Гостей: 32
Пользователей: 0


10 статей
п в с ч п с в
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
   
<< Май 2024 >>
10 файлов
Copyright ООО "Лигнум" © 2008 - 2009
Работает под управлением WebCodePortalSystem v. 5.2
 

Страница сгенерирована за 0.152 сек..