我对这里提出的问题有一个后续问题:
使用以下代码:
public class SuperClass() {
boolean isDoneLoading = false;
ArrayList items;
public SuperClass() {
loadData();
items = new ArrayList();
}
protected void loadData() {
// loadData is a class that requests data from remote server, populates "items"
// and then calls doneLoading when done;
}
protected void doneLoading() {
isDoneLoading = true;
}
}
public class ExtendedClass extends SuperClass {
public ExtendedClass() {
super();
}
protected void doneLoading() {
// how can I get THIS method to be called when the super's doneLoading is called?
}
}
// some other class
new ExtendedClass();
doneLoading()
调用 super 的 doneLoading 类时, 如何获取“child”(ExtendedClass)类?