Java static block is used to initialize the static data member. It is executed before the main method at the time of classloading. Following is the example of static block.
Output: