0% found this document useful (0 votes)
25 views3 pages

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
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views3 pages

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
We take content rights seriously. If you suspect this is your content, claim it here.
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

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy