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

Access Modifier

The document outlines the accessibility of class members in Java based on different access modifiers: public, protected, default, and private. It specifies the access levels for members in the same class, same package using an object, same package using inheritance, different package using an object, and different package using inheritance. Each access modifier has distinct rules regarding visibility across these scenarios.

Uploaded by

uk2921842
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)
2 views1 page

Access Modifier

The document outlines the accessibility of class members in Java based on different access modifiers: public, protected, default, and private. It specifies the access levels for members in the same class, same package using an object, same package using inheritance, different package using an object, and different package using inheritance. Each access modifier has distinct rules regarding visibility across these scenarios.

Uploaded by

uk2921842
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

Access In same In different In different In different In different

modifiers class class in same class in same class in class in


package using package using different different
object inheritance package using package using
object inheritance

public yes yes yes yes yes

protected yes yes yes no yes

default yes yes yes no no

private yes no no no no

You might also like