Quoth JLS #8.1.3:
Inner classes may not declare static initializers (§8.7)......
This is demonstrated as such:<
No Valid Use
just an opinion I came by with, arguments/debates are appreciated
Please read the below thread.
This explains, Why does Java prohibit static fields in inner classes
IMO the same reason also applied to static initializer. After all, the thing that creating problem is the keyword static.
Added to the reason explained in above thread, I can give another lame reason.
The name of the block static initializer give us a hint on when and why to use this block. One does not simply use static initializer block to print hello world [insert the meme here].
The main reason to use this block is clearly to initialize static variable.
Now as inner class/ non-static nested class don't allow static variable, what is the point of allowing static initializer?