| class ZiYiException extends Exception |
| { |
| ZiYiException(String name){ |
| super(name); |
| } |
| } |
| class QiuHe |
| { |
| int sum(int x,int y,int z)throws ZiYiException |
| { |
| if(x<0) throw new ZiYiException("wrong"); |
| return x+y+z; |
| } |
| } |
| 欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |