林笛儿让爱自由落地,海南省人事厅,如果你愿意一层一层的剥开我的心
我怎么知道应该捕获什么样的异常? 马克-to-win:如上例1.1:开始没加try时,程序崩溃,系统打印的是如下的错误,exception in thread "main" java.lang.arithmeticexception: / by zero at test.main(test.java:4),马克-to-win: 所以我们就该捕获arithmeticexception.见下例:1.1.3。
例:1.1.3-
public class test {
public static void main(string[] args) {
try
{
int userinput=0;
int i = 6 / userinput;
}
catch(arithmeticexception e)
{
system.out.println(e);
}
。。。。。。。。。。。。。。。。。
详情请进:
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
浅析我对 String、StringBuilder、StringBuffer 的理解
使用IDEA搭建SSM框架的详细教程(spring + springMVC +MyBatis)
Springboot整合freemarker 404问题解决方案
引入mybatis-plus报 Invalid bound statement错误问题的解决方法
网友评论