throw new 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;}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。