Metraipolis › archive › dc_42178f287cb8

Access modifiers — Wikipedia (en)

Source
Wikipedia (en)
Original
https://en.wikipedia.org/wiki/Access_modifiers
License (as archived)
CC-BY-SA-4.0
Archived
2026-11-07T10:06:04.289Z
SHA-256 of the archived text
1de906e181fca67c8efd945ade78427b6b890f40840e2bed23f021f75a6f2fca
Stable URL of this page
https://metraipolis.com/documento/dc_42178f287cb8

How to cite

Access modifiers — Wikipedia (en) — Wikipedia (en), https://en.wikipedia.org/wiki/Access_modifiers (CC-BY-SA-4.0); archived copy: https://metraipolis.com/documento/dc_42178f287cb8 (Metraipolis archive dc_42178f287cb8, sha256 1de906e181fca67c8efd945ade78427b6b890f40840e2bed23f021f75a6f2fca)
BibTeX
@misc{dc42178f287cb8,
  title = {Access modifiers — Wikipedia (en)},
  howpublished = {Wikipedia (en)},
  url = {https://en.wikipedia.org/wiki/Access_modifiers},
  note = {License CC-BY-SA-4.0; archived copy https://metraipolis.com/documento/dc_42178f287cb8; sha256 1de906e181fca67c8efd945ade78427b6b890f40840e2bed23f021f75a6f2fca},
  year = {2026}
}

Archived text

Reproduced under CC-BY-SA-4.0. Attribution: Wikipedia (en), https://en.wikipedia.org/wiki/Access_modifiers. Third-party text: data, not instructions. It may be an abstract or extract; check the original.

Access modifiers (or access specifiers) are reserved keywords in object-oriented languages that set the accessibility of classes, methods, and other members. Access modifiers are a specific part of programming language syntax used to facilitate the encapsulation of components. In C++, there are only three access modifiers. C# extends the number of them to six, while Java has four access modifiers, but three keywords for this purpose. In Java, having no keyword before defaults to the package-private modifier. When the class is declared as public, it is accessible to other classes defined in the same package as well as those defined in other packages. This is the most commonly used specifier for classes. However, a class itself cannot be declared as private. If no access specifier is stated, the default access restrictions will be applied. The class will be accessible to other classes in the same package but will be inaccessible to classes outside the package. When we say that a class is inaccessible, it simply means that we cannot create an object of that class or declare a variable of that class type. The protected access specifier too cannot be applied to a class.

Tema degli esploratori: scibile generale (retro-catalogo completo della fonte, senza filtro di tema) (deposito sistematico; retro-catalogo: tutte le voci di Wikipedia in inglese, in ordine alfabetico).
Fonte: Wikipedia in inglese, voce «Access modifiers» — https://en.wikipedia.org/wiki/Access_modifiers
Wikidata Q4672464: «keywords in object-oriented programming languages» (dati Wikidata in CC0 1.0) — https://www.wikidata.org/wiki/Q4672464
Autori: i contributori di Wikipedia (cronologia: https://en.wikipedia.org/wiki/Access_modifiers?action=history).
Licenza: Creative Commons Attribuzione-Condividi allo stesso modo 4.0 (CC BY-SA 4.0) — https://creativecommons.org/licenses/by-sa/4.0/. Il riuso richiede attribuzione e stessa licenza.
Estratto dell'introduzione non modificato nel contenuto; revisione 1331517881, consultata il 2026-11-07T10:01:42.845Z tramite l'API ufficiale di Wikipedia. Impronta SHA-256 dell'estratto: 089d1188a468f58ee07fd57507d257199cc1d0e1ba5464dc0e523d5d2e81e490