This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Actually that code is run when the class is loaded. Even when there will never be any object created, the code will still run. What you are thinking about are initializer blocks, which are the same but without the static keyword.
Now these static initializers should be used to run code that are required for a class to function properly. That could be any code required.