Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/338.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java:Enerjy-未检查的异常?_Java - Fatal编程技术网

Java:Enerjy-未检查的异常?

Java:Enerjy-未检查的异常?,java,Java,Enerjy对这行代码有问题: private static List<ParseTree> getTestTrees(Xml test) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { 我怎样才能解决这个问题?有什么问题?“未检查”异常是什么意思?“未检查”异常(也称为)是编译器不会强制您捕获的异常。例如,想象一下,如果您必须在任何可能发生的地方声明并捕获Nu

Enerjy对这行代码有问题:

private static List<ParseTree> getTestTrees(Xml test) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
我怎样才能解决这个问题?有什么问题?“未检查”异常是什么意思?

“未检查”异常(也称为)是编译器不会强制您捕获的异常。例如,想象一下,如果您必须在任何可能发生的地方声明并捕获
NullPointerException
。这些是异常的类型,如果它们发生,假设您的程序可能无论如何都无法恢复


编译器告诉您从方法的
throws
子句中删除
IllegalArgumentException

如果我错了,请纠正我,但这不是警告,不是错误吗?
(Baseline) JAVA0126 Method 'getTestTrees' declares unchecked exception 'IllegalArgumentException' in throws