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?
- A.
private
- B.
public
- C.
package-private
- D.
More than one of the above
- 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.