Java: Protection Type of Variables, Methods or Classes
Package Protection (DEFAULT) |
|
Private |
|
Public |
|
Protected |
|
Handy-Dandy Cross-Reference Table
Same Class | Sub Class | Same Package | Class outside package | |
---|---|---|---|---|
public | X | X | X | X |
protected | X | X | X | (only subclasses) |
private | X | |||
package protected (default) | X | X | X |