|published||visible to external users of a Javabean||Javabean properties and methods. There is no way to declare a method published in the Java source. You use a special getXXX/setXXX naming convention and write a separate declaration file.|
|public||visible to all classes||methods and variables of interest to users of the class.|
|protected||visible to classes outside the package that inherit the class, also to all classes in the package.||methods and variables of interests to third parties who may extend your class.|
|visible to all classes of the package.||methods and variables involved in cross-class communication within the package. Java 1.8 now has a default keyword. However, it does not mean package scope. It is used in interfaces to make them behave more like abstract classes, providing default implementations.|
|private||visible only within the class, not by inheritors, not by other classes in the package.||Variables and methods that should not or would not be changed by someone extending the class. Proper functioning of the class depends on them working precisely as written.|
|local||visible only to the block of the method in which the variables were declared.||Temporary working variables.|
|Permitted class scopes|
|top level class|
|static nested class|
This page is posted
Optional Replicator mirror
Please read the feedback from other visitors, or send your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.
Your face IP:[22.214.171.124]
You are visitor number|