|
火龙骑士的代码里不是方法的覆盖吗?
来自JAVA原版教材对OVERRDING 方法中异常的处理
The declared exception class must be the same class or a subclass.
For example, if the superclass method throws an IOException,
then the overriding method can throw an IOException, a
FileNotFoundException (a subclass of IOException), but not an
Exception (the superclass of IOException)
l Fewer exceptions may be declared in the throws clause.
l New exceptions may not be added to the throws clause.
但问题提出的是明明是方法的覆盖,而不是重载,很明显是在两个类里面的方法,不会是重载吧? |
|