What access level does a Java class member have when no access modifier is written?
Correct answer C. Package-private, visible only within its package
Explanation
Leaving out the modifier gives package access, so only code in the same package can use the member. It is more restrictive than protected, because a subclass in another package cannot reach it. Note that this default applies to class members only, since members of an interface are implicitly public.
Answer checked How we write and check questions
Discussion