Restart myself - can I reinitialize everything from scratch?

后端 未结 6 1442
無奈伤痛
無奈伤痛 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:23

    how about this structure

    public static void main(String... args) {
    
        boolean restart = true;
        while (restart )
        {
            retart = runApplication();
        }
    
    }
    

    If you ever detect the need to restart you application, have runApplication return true. If it is time to exit return false;

提交回复
热议问题