Protected
members are accessible from within Class
, Same package
and in Subclass
. It doesn't have access to the World
(other than mentioned above)
See the below table
The following table shows the access to members permitted by each modifier.
Access Levels
Modifier Class Package Subclass World
public Y Y Y Y
protected Y Y Y N
no modifier Y Y N N
private Y N N N