Course Content
Core Java
About Lesson

Public

Public top-level classes, members (fields, methods), interfaces, abstract classes and inner classes are accessible from any other class in any package.

Default (Package – Private) – No Access Modifier specified

Data members (fields, methods), classes, interfaces or abstract classes that are not declared using any access modifiers i.e. having default access modifiers are accessible only within the same package.

Protected

Data members (fields, methods), inner classes, etc declared as protected are accessible within the same package or subclasses in different packages.

Private

Data members (fields, methods), inner classes, etc declared as private are accessible only within the class in which they are declared.

Scroll to Top