Skip to content

Instantly share code, notes, and snippets.

@li2
Last active March 20, 2018 07:08
Show Gist options
  • Save li2/b3463697a9c3987ae42bc94cdd1f104d to your computer and use it in GitHub Desktop.
Save li2/b3463697a9c3987ae42bc94cdd1f104d to your computer and use it in GitHub Desktop.
[Difference among 'public', 'default', 'protected', and 'private`] http://stackoverflow.com/questions/215497/difference-among-public-default-protected-and-private #tags: java
| Class | Package | Subclass | World
————————————+———————+—————————+——————————+———————
public | + | + | + | +
————————————+———————+—————————+——————————+———————
protected | + | + | + |
————————————+———————+—————————+——————————+———————
no modifier | + | + | |
————————————+———————+—————————+——————————+———————
private | + | | |
+ : accessible
: not accessible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment