何时在Java中调用System.Exit在Java中,有或没有什么区别System.exit(0)在下面的代码中?public class TestExit{
public static void main(String[] args)
{
System.out.println("hello world");
System.exit(0); // is it necessary? And when it must be called?
} }这个文件说:“这个方法永远不会正常返回。”什么意思?
3 回答

largeQ
TA贡献2039条经验 获得超7个赞
System.exit(0);System.out.println("This line will never be reached");
System.exit()
添加回答
举报
0/150
提交
取消