If I type:
void doThis(){
System.out.println("Hello Stackoverflow.");
}
what is the default scope of 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