System.exit()用来结束当前运行的java虚拟机,参数n表示退出的状态码。
这个状态码没有特别规定,但是按照约定俗成,非0表示异常退出,0表示正常退出,因此一般用0、-1多一些。c/c++里面也是这样的
这个状态码没有特别规定,但是按照约定俗成,非0表示异常退出,0表示正常退出,因此一般用0、-1多一些。c/c++里面也是这样的
解决方案 »
- 重写的equals()和hashCode()是如何被调用的?
- java oop
- eclipse中的快捷键
- 请教一个?判断结果的问题
- 如果使窗口总在最前?
- 读大txt文件,写入数据库.提高速度的办法.
- action forward 打开新窗口
- 在java控制台程序中,怎么读入组合键ctrl+z?
- JAVA SWING中的JTable的问题~
- 为什么出现错误:Error occurred during initialization of VM
- 谁有java2图形设计 卷II:Swing 的例程,麻烦给一份 [email protected]
- jndi连mssql2000的问题!!!!!!搞了一天了!!帮帮我!!
This method calls the exit method in class Runtime. This method never returns normally.
public static void exit(int status)
Terminates the currently running Java Virtual Machine. The argument serves as a status code; by convention, a nonzero status code 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 to the call: Runtime.getRuntime().exit(n)
Parameters:
status - exit status.
Throws:
SecurityException - if a security manager exists and its checkExit method doesn't allow exit with the specified status.
See Also:
Runtime.exit(int)