0% found this document useful (0 votes)
17 views1 page

Same Class Same Package Sub Class Other Packages Public Protected Default Private

This document outlines Java access modifiers and their effects on classes and packages. It shows that public and protected members are accessible within the same class, package, and subclasses regardless of package, while default is only accessible within the same class and package and private is only accessible within the same class.

Uploaded by

Siva Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views1 page

Same Class Same Package Sub Class Other Packages Public Protected Default Private

This document outlines Java access modifiers and their effects on classes and packages. It shows that public and protected members are accessible within the same class, package, and subclasses regardless of package, while default is only accessible within the same class and package and private is only accessible within the same class.

Uploaded by

Siva Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Same Class

Same
Package

Sub Class

Other
Packages

public

YES

YES

YES

YES

protected

YES

YES

YES

NO

Default

YES

YES

NO

NO

private

YES

NO

NO

NO

You might also like