First thing you can't put executable code(I am not sure if this is correct
word) directly in to the class, I meant that you can declare variables. place static blocks, inner class just inside the class but can't put like below
this is why you are getting error when you remove the curly braces from the code, just put that block inside some method and remove the braces, it will work fine(off course you have to take care of scope of the "states").
Second thing what I can understand is that the block mentioned here just inside the class is working as Initialization block and will initialize the values before the constructor is called. So this is one of the way to initialize the values in the variable. However I am not sure, may be someone else can elucidate it better.