Java Professional — Easy
Key points
- Protected allows access from same package and subclasses in different packages
- Private restricts access to the class itself
- Public allows access from anywhere
- Default (package-private) only allows access within the same package
Ready to go further?
Related questions
