如果子类要重写父类中某个声明会抛出异常(throws Exception)的方法时,子类的该方法只能声明抛出被其重写的父类方法所声明的异常的子集。即:不能声明可能抛出新的父类方法没有声明的异常。
基于10个网页-相关网页
If the XML parser sees a null character in its input, it throws an exception and stops processing.
如果 XML 分析程序在其输入中看到一个空字符,它就会发出异常并停止处理。
This operation throws an exception.
该操作将抛出一个异常。
If you can't, declare that the enclosing method itself throws the exception.
如果不能,那么声明包装方法本身抛出异常。
But if I say turn this into a float, ah it throws a value error exception.
它就会抛出一个值错误异常了,它会告诉我输入了一种错误的值。
应用推荐