62,615
社区成员
发帖
与我相关
我的任务
分享
public class TestTryCatch {
public static void main(String[] args){
int i = 1;
int j = 0;
try{
System.out.println("Try block entered " + "i = " + i + " j = " + j);
System.out.println(i/j);
System.out.println("Ending try block");
}catch(ArithmeticException e){
System.out.println("Arithmetic exception caught");
}
System.out.println("After try block");
return; //这里放return有什么意义吗?什么情况下要在main( )方法里放return??
}
}