If the return type is not a part of method signature in Java, why must an overriding method have the same as its parent?

前端 未结 0 1377
北恋
北恋 2021-02-02 12:36

Is there any particular reason why Java does not allow method overriding by changing the return type of a sub-class?

Since the return type is not part of the method signa

相关标签:
回答
  • 消灭零回复
提交回复
热议问题