异常处理问题

shenzuyan 2009-09-24 12:16:09
public class TestEx {
public static void main(String[] args){
TestEx te = new TestEx();
te.m(0);

}
void m(int i) throws ArithmeticException {
if(i == 0)
throw new ArithmeticException("");
}

}



运行时好像说在 throw new ArithmeticException(""); 这行出现非法字符 :\65307
...全文
67 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Jamin_Ma 2009-09-24
  • 打赏
  • 举报
回复
自己定义的异常传递是个String吧,试试看。
Leson_Yin 2009-09-24
  • 打赏
  • 举报
回复
最好一行的分号是中文状态下输入的吧。。
呵呵。。
写程序的时候把中文输入状态关掉。

62,621

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧