Last active
March 20, 2018 07:08
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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