Callum Ludwig wrote:Static code blocks are run when you create an object of the class
That's one of several possible events that would trigger execution of static initializers. A complete list is given in JLS 12.4.1 which I linked to above.
Since this is currently posted in Beginner, I would also note that beginning programmers don't really need to know or worry about this. For those of you who find it interesting and want to know more, that's great, but the topic should probably be moved so as not to scare off the other beginners.