JAVA关闭当前进程(虚拟机)

System.exit(int);

Terminates the currently running Java Virtual Machine. Theargument serves as a status code; by convention, a nonzero statuscode indicates abnormal termination.

This method calls the exit method in class Runtime. This method never returns normally.

The call System.exit(n) is effectively equivalent tothe call:

Runtime.getRuntime().exit(n)

你可能感兴趣的:(JAVA关闭当前进程(虚拟机))