Posts

Showing posts with the label public

Java Modifiers

Image
In the Java it is possible to modify classes, methods, etc., by using modifiers. There are two categories of modifiers:   1.  Access Modifiers:   default, public , protected, private                   Java provides a number of access modifiers to set access levels for                   classes, variables, methods and constructors.              The four access levels are:          Visible to the package, the default. No modifiers are needed.          Visible to the class only (private).          Visible to the world (public).          Visible to the package and all subclasses (protected).     2.  Non-access Modifiers:   static, final, abstract, synchronized, volatile .   ...