我怀疑我想做的事情是否可行。我有三个类 A,B y C。B 扩展 A,C 扩展 B。
C -> B -> A。
在C类中,我想直接调用A类的方法。就像是
super.super.method();
我有机会吗?
原因:
A 和 B 是系统类。我试图让 B 以不同的方式处理某些情况,除了一种方法外,我已经完成了它。在其他方法中,我所做的是覆盖它们并传递修改过的参数。
现在我有一个方法,我不能仅仅修改参数来解决,所以我想完全覆盖它。
乙
@Override
public void draw(Canvas canvas) {
super.draw(canvas); // A method
** other stuff **
}
我想用 C 做什么
@Override
public void draw(Canvas canvas) {
super.super.draw(canvas); // A method
** new stuff **
}