Exception and Inheritance in Java

后端 未结 5 2002
旧巷少年郎
旧巷少年郎 2021-01-04 12:59

Suppose we have this problem

public class Father{
    public void method1(){...}
}

public class Child1 extends Father{
    public void method1() throws Exce         


        
5条回答
  •  忘掉有多难
    2021-01-04 13:31

    The "throws" part is a part of the method signature.
    This is why the method at the "child" class is not an override of the method of the parent class.

提交回复
热议问题