1.4. Java access modifiers

[6.4] Apply access modifiers

In this section, we’ll cover all the access modifiers—public, protected, and private—as well as default access, which is the result when you don’t use an access modifier. We’ll also look at how you can use access modifiers to restrict the accessibility of a class and its members in the same and separate packages.

Get OCA Java SE 8 Programmer I Certification Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.