通过本教程https://developers.google.com/web-toolkit/doc/latest/tutorial/RPC提到要设置回调对象,必须执行以下操作:
// Set up the callback object.
AsyncCallback<StockPrice[]> callback = new AsyncCallback<StockPrice[]>() {
public void onFailure(Throwable caught) {
// TODO: Do something with errors.
}
public void onSuccess(StockPrice[] result) {
updateTable(result);
}
};
但是我注意到 AsyncCallback 是一个接口。据我所知,接口无法实例化。这怎么可能?