I came across this Java code:
static {
String aux = \"value\";
try {
// some code here
} catch (Exception e) { }
String UUID_prefix =
Sufyan,
Static initializers aren't inherited and are only executed once when the class is loaded and initialized by the JRE. That means this static block will be initialized only once irrespective of how many objects you have created out of this class.
I am not a big fan of it and i am sure there are better alternatives for it depending on the situation.
Thanks, Reds