Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 905 Bytes

Access Modifiers.md

File metadata and controls

21 lines (13 loc) · 905 Bytes

Java Access Modifiers

Public Access Modifier

The public access modifier is the most accessible access modifier. It means that the class, method, or field can be accessed from anywhere in the program.

Protected Access Modifier

The protected access modifier is more accessible than the default access modifier. It means that the class, method, or field can be accessed from anywhere in the package in which it is declared, and from any subclass of the class in which it is declared.

Default Access Modifier

The default access modifier is less accessible than the protected access modifier. It means that the class, method, or field can be accessed from anywhere in the package in which it is declared.

Private Access Modifier

The private access modifier is the least accessible access modifier. It means that the class, method, or field can only in the class in which it is declared.