java中的System.exit()方法的源代码:
public static void exit(int status) {
Runtime.getRuntime().exit(status);
}
从这段代码中可以看出status非零时是非正常关闭,status为零时是正常关闭。另外exit关闭是不释放内存资源的。
一般对于System.exit(1)的使用是用在判断异常try....catch中的catch块中,例如:
try{
.........
}catch(Exception e){
System.exit(1);
}
还有一些详细的内容https://blog.csdn.net/maihilton/article/details/41541707