开发者

Java question about super

开发者 https://www.devze.com 2023-02-20 13:37 出处:网络
If A extends B, t开发者_如何学Gohen I know I can user super.* to access B\'s method. What if A extends B and B extends C, how to access C\'s method from A?If a method is overriden in B, you cannot \"

If A extends B, t开发者_如何学Gohen I know I can user super.* to access B's method.

What if A extends B and B extends C, how to access C's method from A?


If a method is overriden in B, you cannot "bypass" it.

It's not possible even when using reflection (not in any way known to me).


not sure but I think you can do super.super.methodA ?

0

精彩评论

暂无评论...
验证码 换一张
取 消