Inheritance in Java: Why is a casted variable access differently resolved than a casted method call

后端 未结 0 1648
后悔当初
后悔当初 2021-01-07 02:17

How does inheritance work (in Java) when casting is involved? Casting works as expected with instance variables but not with methods.

Given the following code, which

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