Multiple choice technology programming languages

Which access modifier allows to access only within the package?

  1. public

  2. private

  3. default(no access modifier)

  4. protected

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The default access modifier (no keyword used) restricts access to classes within the same package. 'Private' is class-only, 'Protected' includes subclasses in other packages, and 'Public' is accessible from everywhere.