If I type:
void doThis(){ System.out.println("Hello Stackoverflow."); }
what is the default scope of doThis()?
doThis()
Public? Protected? Private?
The default scope is package-private. All classes in the same package can access the method/field/class. Package-private is stricter than protected and public scopes, but more permissive than private scope.
More information: http://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html http://mindprod.com/jgloss/scope.html
1.4m articles
1.4m replys
5 comments
57.0k users