Which of the following is NOT an access modifier in Java?

2025

Which of the following is NOT an access modifier in Java?

Answer: D. accessibleConceptAn access modifier is a Java language keyword placed in a declaration to control where a class or member can be accessed. For class members, Java…

  1. A.

    public

  2. B.

    private

  3. C.

    protected

  4. D.

    accessible

Attempted by 340 students.

Show answer & explanation

Correct answer: D

Concept

An access modifier is a Java language keyword placed in a declaration to control where a class or member can be accessed.

For class members, Java provides the explicit modifiers public, protected, and private; package-private access is obtained by writing no access modifier.

Application

Classify each offered term by checking whether it is a Java keyword used to declare an access level.

Contrast of the offered values

  • public is an explicit Java access modifier that allows the broadest visibility permitted by the declaration context.

  • private is an explicit Java access modifier that limits member access to the enclosing class.

  • protected is an explicit Java access modifier that permits package access and also supports subclass access subject to Java rules.

  • accessible is an English adjective used to describe reachability; it is not a Java access-modifier keyword.

Cross-check

Oracle Java documentation lists member access as public, protected, private, or package-private with no modifier. The word accessible does not appear in that modifier set.

Result

Therefore, accessible is the offered term that is not a Java access modifier.

Explore the full course: Tpsc Assistant Technical Officer

Loading lesson…