没错,抛出异常有两种形式
一种是 throws
比如:
public method1 () throws Exception1{}
以后使用此方法就一定要捕获异常
另一种 throw
public methd (){
int k = i/j;
if (j == 0){
throw new Exception1();
}
}
一种是 throws
比如:
public method1 () throws Exception1{}
以后使用此方法就一定要捕获异常
另一种 throw
public methd (){
int k = i/j;
if (j == 0){
throw new Exception1();
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货