System.exit(0)中的0是什么意思 ?

sinapaper 2002-03-30 03:19:20
在关闭窗口事件中,是用System.exit(0)退出的,可是这里的参数0是干什么的?好象也可以用参数1,2....可是不同的参数都有什么具体的作用?
...全文
266 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
sunwukong 2002-03-30
  • 打赏
  • 举报
回复
参数:
0。正常退出
1。非正常退出
2。强制退出
给分
websa 2002-03-30
  • 打赏
  • 举报
回复
好像是-1吧?
hujianok 2002-03-30
  • 打赏
  • 举报
回复
看看它吧:
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)
aph 2002-03-30
  • 打赏
  • 举报
回复
在linux/unix系统中用来向进程传递返回参数,其实就是调用java YouClass的那个程序,比如bash
dobad 2002-03-30
  • 打赏
  • 举报
回复
参数是0,一般表示是正常退出。大多数人的习惯而已,也可以是别的.

23,407

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧