开发者

How do I call an overridden method one level up in java?

I have an abstract base class. I have a class2 that extends base class. I have a class3 that extends class2. I have overridden abstract baseclass.method1 in both class2 and class3. in class3.method1, I call su开发者_开发知识库per.method1 and the error I get is that I can't directly call the abstract method in baseclass. but I don't want to, I just want to go one level up, I want to call class2.method1, not baseclass.method1. How to do that?


.super() in class3 should call methods defined in class2.


I withdraw the question, it turns out class2 had a typo in it so the method1 didn't have the same name. whoops.


Well, it should work. Class3.method1() super calls Class2.method1, don't understand the problem __

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜