2013-07-14 132 views
0

我想我Widgets类的get方法来扩展超org.powerbot.game.api.methods.Widgets的方法,但我得到一个编译错误:无法覆盖的超

enter image description here

然而,超显然有匹配get方法: enter image description here

+1

静态方法不是特定于类 –

回答

3

static方法在Java中不是多态的。换句话说,他们不能被重写。

0

@Overide注释用于标记重写的方法。 java中不能覆盖静态方法。但是你可以重新定义它们。只需删除注释。您可以选择在子类静态方法内调用超级静态方法。