What does Static {} mean in the Java Syntax?

后端 未结 7 1263
野趣味
野趣味 2020-12-13 13:49

I came across this Java code:

static {
    String aux = \"value\";
    try {
        // some code here
    } catch (Exception e) { }
    String UUID_prefix =         


        
7条回答
  •  猫巷女王i
    2020-12-13 13:58

    This is the block of code that will get invoked when your class is loaded by classloader

提交回复
热议问题