https://www.javatpoint.com/access-modifiers
Access Modifier | within class | within package | outside package by subclass only | outside package |
---|---|---|---|---|
Private | Y | N | N | N |
Default | Y | Y | N | N |
Protected | Y | Y | Y | N |
Public | Y | Y | Y | Y |
https://www.javatpoint.com/access-modifiers
Access Modifier | within class | within package | outside package by subclass only | outside package |
---|---|---|---|---|
Private | Y | N | N | N |
Default | Y | Y | N | N |
Protected | Y | Y | Y | N |
Public | Y | Y | Y | Y |