Why parent class method is getting called and not child class in this case?

前端 未结 4 921
长情又很酷
长情又很酷 2021-01-20 06:16

I have a parent class A, and its child B. Both are having doSomething method with diff type of parameters.

Class A

package Inheritance;
         


        
4条回答
  •  一整个雨季
    2021-01-20 06:27

    I guess this is not considered a case of method overriding because the signatures are not exactly the same. Change the String argument to Object in B.

提交回复
热议问题