Restart myself - can I reinitialize everything from scratch?

后端 未结 6 1488
無奈伤痛
無奈伤痛 2021-01-27 01:27

I have something like this:

public static final String path;
static {
    path = loadProperties(\"config.conf\").getProperty(\"path\");
}

public static void mai         


        
6条回答
  •  青春惊慌失措
    2021-01-27 02:29

    You can start your application using a custom class loader, this will allow you to load and unload your static variables.

    However, basically its a very bad design to need to do this. I like making fields final, but you shouldn't make them final if you want to change them.

提交回复
热议问题