overload  vs.  override找本书看看吧

解决方案 »

  1.   

    It's a overload not a override!!!
    Because override only occurs when the method signature is the same.
    You must distinguish overload and override, some books did not express these two concepts very good.
      

  2.   

    当然算重载了class superclass {
    void method(String s) {
    System.out.println(s);
    }
    }public class subclass extends superclass {
    void method(int s) {
    System.out.println(s);
    }
    public static void main(String[] args) {
    subclass sub1=new subclass();
    sub1.method("aaa");
    sub1.method(555);
    }
    }
      

  3.   

    可以理解为“重载(overload)“和“覆盖(override)”,这样比“重载”和“重置”好理解。