方法源码:

/**
* Terminates the currently running Java Virtual Machine. The
* argument serves as a status code; by convention, a nonzero status
* code indicates abnormal termination.
* <p>
* This method calls the <code>exit</code> method in class
* <code>Runtime</code>. This method never returns normally.
* <p>
* The call <code>System.exit(n)</code> is effectively equivalent to
* the call:
* <blockquote><pre>
* Runtime.getRuntime().exit(n)
* </pre></blockquote>
*
* @param status exit status.
* @throws SecurityException
* if a security manager exists and its <code>checkExit</code>
* method doesn't allow exit with the specified status.
* @see java.lang.Runtime#exit(int)
*/
public static void exit(int status) {
Runtime.getRuntime().exit(status);
}

这个方法将当前运行的Java虚拟结束,非0状态表示非正常退出

说明:

  1. System.exit(0)是正常退出程序,会将整个虚拟机里的内容都停掉清空
  2. System.exit(1)或者说非0表示非正常退出程序

最新文章

  1. git&amp;sourcetree安装及在IntelliIJ下拉取项目基础使用
  2. 企业搜索引擎开发之连接器connector(三十)
  3. javascript event兼容性随笔
  4. bash 操作 sqlite3
  5. 【CodeVS】p1174 靶形数独
  6. hdu1028 Ignatius and the Princess III
  7. linux Shell的使用
  8. RabbitMQ介绍2 - AMQP协议
  9. OC:通讯录实战
  10. [Everyday Mathematics]20150208
  11. USB模式安装CentOS6.4_minimal
  12. msql修改字符
  13. 关于php-fpm通讯时没有REQUEST_METHOD的问题
  14. StarTeam SDK 13 下载安装
  15. ONFI闪存数据通道接口标准
  16. iPhone页面的常用调试方法
  17. OC中的类别Category-协议Protocol-…
  18. H5如何解监听页面退出需求???
  19. laravel——基础增删改查
  20. heroku 部署ruby项目后 未连接数据库显示(We&#39;re sorry, but something went wrong. If you are the application owner )

热门文章

  1. spring boot application 配置详情
  2. 使用GPU跑Tensorflow代码实录
  3. c# webapi结合swagger的使用
  4. J-Subarray_2019牛客暑期多校训练营(第二场)
  5. CodeForces 346C Number Transformation II
  6. CodeForces Round 525
  7. Spring Boot与Spring MVC集成启动过程源码分析
  8. 那些年,我们误解的 JavaScript 闭包
  9. 【第十六篇】这一次要写的是bootstrap-table
  10. 使用HTML制作网页