System.exit(0)
来源:互联网 发布:网络最火游戏排行榜 编辑:程序博客网 时间:2024/05/09 18:34
这个方法是用来结束当前正在运行中的java虚拟机。如何status是非零参数,那么表示是非正常退出。
- System.exit(0)是将你的整个虚拟机里的内容都停掉了 ,而dispose()只是关闭这个窗口,但是并没有停止整个application exit() 。无论如何,内存都释放了!也就是说连JVM都关闭了,内存里根本不可能还有什么东西
- System.exit(0)是正常退出程序,而System.exit(1)或者说非0表示非正常退出程序
- System.exit(status)不管status为何值都会退出程序。和return 相比有以下不同点:return是回到上一层,而System.exit(status)是回到最上
在一个if-else判断中,如果我们程序是按照我们预想的执行,到最后我们需要停止程序,那么我们使用System.exit(0),而System.exit(1)一般放在catch块中,当捕获到异常,需要停止程序,我们使用System.exit(1)。这个status=1是用来表示这个程序是非正常退出。
- System.exit(0),System.exit(1)和System.exit(-1)
- System.exit(0)和System.exit(1)
- System.exit(-1);和System.exit(0);
- //System.exit(0);
- System.exit(0)
- System.exit(0)
- System.exit(0)
- System.exit(0)
- System.exit(0)和System.exit(1) 和return
- System.exit(0)和System.exit(1)区别
- the different between System.exit(0) and System.exit(1)
- System.exit(0)和System.exit(1)区别
- . System.exit(0)和System.exit(1) 和return 区别
- System.exit(0)与System.exit(1)的区别
- android中System.exit(0)和System.exit(1)区别
- system.exit(0)和system.exit(1)的区别
- System.exit(0)及System.exit(1)的作用
- java System.exit(0)和System.exit(1)区别
- java.lang.NoClassDefFoundError
- 我是怎样看待微博的
- 对HashMap中的实体类进行排序
- Objective-C runtime之运行时的基本特点(一)
- (转)C# Enum,Int,String的互相转换 枚举转换
- System.exit(0)
- 遇到的问题-----c#操作mongodb用foreach遍历集合报错curcor not found
- RMAN catalog 的创建和使用
- 如何生成axis1.4客户端
- [C#] 程序实例中使用多份log4net logger
- 通过Pull解析器解析xml文件
- 关于typedef的用法总结
- android 图片浏览(支持左右平滑滑动和pinch缩放)
- MFC生成ID