What is the explanation for the different access modifiers in Java?

Java

1 answer

Answer

1065954

2026-04-24 22:41

+ Follow

An Access Modifier is a key Word in Java that determines what level of access or visibility a particular Java variable/method or class has. There are 4 basic access modifiers in Java. They are:

  1. Public
  2. Protected
  3. Unspecified (package-private)
  4. Private

Classes can only be declared public or left unspecified (the "package-private" default level). Methods can be declared any of the above.

See the Link on the Java Tutorial for a very good explanation of the various levels of access each modifier provides.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.