What is the access specifier used to make members of a class accessible only…

2024

What is the access specifier used to make members of a class accessible only within the same package?

  1. A.

    private

  2. B.

    public

  3. C.

    package-private

  4. D.

    More than one of the above

  5. E.

    None of the above

Attempted by 106 students.

Show answer & explanation

Correct answer: C

In Java, members with no explicit access modifier have package-private access, meaning they are accessible within the same package.

Explore the full course: Up Lt Grade Assistant Teacher 2025