java program to demonstrate static block code example

Example 1: what is static block

Static Block:
 used for initializing statics members,
it belongs to the class and only one copy
and runs only once and before everything

I use it in configuration.reader class
  in my framework

Example 2: static variables java

Static keyword is used a lot in java. 
 Static means, you
can access those static variables
without creating an object,
just by using a class name.
This means that only one instance of
that static member is created which
is shared across all instances of the class.
Basically we use static keyword when
all members share same instance.

Tags:

Java Example