用户定义的异常是已检查或未检查的异常 [英] User defined exception are checked or unchecked exceptions
本文介绍了用户定义的异常是已检查或未检查的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的Web应用程序中创建了一个用户定义的异常,扩展了Exception.Is it Checked或unchecked exception
In my web application created a User defined exception extends with Exception.Is it Checked or unchecked exception
public class InvalidDataException extends Exception{
public InvalidDataException() {
super();
// TODO Auto-generated constructor stub
}
/**
* @param arg0
*/
public InvalidDataException(String message) {
super(message);
// TODO Auto-generated constructor stub
}
}
推荐答案
只有那些属于的子类的例外 RuntimeException
被视为未选中。
你的不是,和因此是已检查例外。
Yours isn't, and therefore is a checked exception.
这篇关于用户定义的异常是已检查或未检查的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文