一 exit()
exit(0) 虚拟机正常退出
exit(1)不正常退出
二 代码
利用exit()中断程序执行
/**
* Created by hanshan on 2017/1/7 0007.
*/
public class exitDemo {
public static void main(String[] args){
System.out.println("我是小明");
System.exit(1);
System.out.println("我是小红");
}
}