main函数代码如下:
public static void main(String[]agrs)throws Exception
{
System.out.println(1);
throw new Exception();
}
不断重复运行,输出结果有两种:
第一种(我认为是符合预期的结果)——
——————————————————————————————————————————
1
Exception in thread "main" java.lang.Exception
at Deleteme.main(Deleteme.java:69)
——————————————————————————————————————————
第二种(奇怪的结果)——
——————————————————————————————————————————
Exception in thread "main" java.lang.Exception
at Deleteme.main(Deleteme.java:54)
1
——————————————————————————————————————————
问题就是,同样的代码,为什么输出不同?