0% found this document useful (0 votes)
14 views

Java Access Modifier

The document discusses Java access modifiers which are used to set the visibility of classes, interfaces, variables, methods, constructors, data members, and setter methods. It describes the default, private, protected, and public access modifiers and their levels of visibility.

Uploaded by

Dipendra Km
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Java Access Modifier

The document discusses Java access modifiers which are used to set the visibility of classes, interfaces, variables, methods, constructors, data members, and setter methods. It describes the default, private, protected, and public access modifiers and their levels of visibility.

Uploaded by

Dipendra Km
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 3

JAVA ACCESS

MODIFIERS
What is access modifier ?

In Java, access modifiers are used to set the accessibility (visibility) of classes, interfaces,
variables, methods, constructors, data members, and the setter methods.
class Animal {
public void method1() {...}

private void method2() {...}



Types of Access Modifier

Modifier Description

declarations are visible only within the


Default
package (package private)

Private declarations are visible within the class only

declarations are visible within the package or


Protected
all subclasses

Public declarations are visible everywhere

You might also like