I have following class hierarchy scenario; Class A has a method and Class B extends Class A, where I want to call a method from super class from a locally nested class.
I hope a skeletal structure picture the scenario more clearly
Does Java permit such calls?
class A{
public Integer getCount(){...}
public Integer otherMethod(){....}
}
class B extends A{
public Integer getCount(){
Callable<Integer> call = new Callable<Integer>(){
@Override
public Integer call() throws Exception {
//Can I call the A.getCount() from here??
// I can access B.this.otherMethod() or B.this.getCount()
// but how do I call A.this.super.getCount()??
return ??;
}
}
.....
}
public void otherMethod(){
}
}
You can just use
B.super.getCount()to callA.getCount()incall().