2011年8月9日

在catch块中throw new Exception的意义

摘要: thrownew Exception(String,Exception)throw new Exception(String)throw是明确地抛出异常throw new Exception("自定义抛出错误的原因").public doube Division(double a,double b){ if(b==0) { throw new Exception("除数不能为0"); }return a/b;} 阅读全文

posted @ 2011-08-09 11:24 路人 阅读(500) 评论(0) 推荐(0) 编辑

导航