下面给个小例子,来验证一下error的捕获。
public testcatcherror(){
super();
}
public testcatcherror(string msg){
super(msg);
}
public static void main(string[] args) {
try {
throw new testcatcherror("test catch error");
} catch (throwable t) {
system.out.println("step in the catch ~");
t.printstacktrace();
}
}
}
运行结果:
如对本文有疑问, 点击进行留言回复!!
[杭电多校2020]第一场 1004 Distinct Sub-palindromes
Swift -- 将本地生成的UIImage进行持久化保存(存到文件中fileManager.createFile)
网友评论