Access Modifiers in Java
Access Modifiers in
java Modifiers in Java
Access
Access Control Modifiers:
Java provides a number of access modifiers to set
access levels for classes, variables, methods and
constructors. The four access levels are:
Visible to
needed.
Visible to
Visible to
Visible to
the package, the default. No modifiers are
the class only (private).
the world (public).
the package and all subclasses(protected).
Final
Final is used to apply restrictions on class,
method and variable. Final class can't be
inherited, final method can't be overridden
and final variable value can't be changed.
Final is a keyword.
Finally
Finally is used to place important code, it
will be executed whether exception is
handled or not.
Finally is a block.
Finalize
Finalize is used to perform clean up
processing just before object is garbage