||Can be used on
||Abstract class contains
unimplemented methods. And it cannot be instantiated
||Abstract method has
only signature no implementation. The containing
class is abstract
||All interfaces are
||Make an inner class
||A static method is
invoked through the class name. A static method
can access only static variables. Also Static
methods may not be overridden to be non-static.
||Static variables are
initialized at class load time. A class has
only one copy of these variables.
|Free floating code-block
||Run when the class
is loaded, rather than when an instance is created.
||Can be applied to methods only. (Static
||It means method is written in a non-Java
language, compiled for a single machine target
type. Native doesn't affect access qualifiers.
Native methods can be private.You can pass/return
Java objects from native methods
||Final classes cannot
||Final methods cannot
||Final variables cannot
be changed. (Either a value has to be specified
at declaration or an assignment statement can
appear only once).
||Cannot change its value.
Static final fields are compile-time constants.
||Can be applied to methods or parts of methods
||Used to control access to critical code
in multi-threaded programs. .For a static method,
a lock for the class is acquired before executing
the method. For a non-static method, a lock
for the specificobject instance is acquired.
||Can be applied to variables, static variables
but NOT final variables
||Declaring a variable volatile indicates
that it might be modified asynchronously, so
that all threads will get the correct value
of the variable.Used in multi-processor environments
||Can be applied to class level variables
only.(Local variables cannot be declared transient)
||Transient variables may not be final or
static.(But compiler allows the declaration,
since it doesn't do any harm. Variables marked
transient are never serialized. Static variables
are not serialized anyway.) Not stored as part
of object's persistent state, i.e. not written
out during serialization. Can be used for security.