下面的异常程序哪里出错?

 

class  Demo

{

int div(int a,int b)throws   FuShuException

{

if(b<0)

throw  new  FushuException();

return  a/b;

}

}

class  ExceptionDemo3

{

public  static  void  main(String[] args)

{

Demo  d=new  Demo();

try

{

int  x=d.div(4,1);

System.out.println("x="+x);

}

catch(FuShuException e)

{

System.out.println(e.toString());

System.out.println("除数出现负数了");

}

System.out.println("over");

}

}


qq_丘比特_0
浏览 1149回答 1
1回答

疏影寒秋

FuShuException 什么鬼 这还能自定义
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java