【发布时间】:2013-04-30 01:04:35
【问题描述】:
如何使以下 Java 代码工作:
public class Worker implements Callable<myObject>{
@Override
public ArrayList<myObject> call() throws Exception {
ArrayList<myObject> lst_MyObjects= new ArrayList<myObject>();
return lst_MyObjects;
}
}
错误:返回类型与Callable.call()不兼容
我只想返回一个特定类型的容器(Vector<> / ArrayList<> 等)
【问题讨论】:
-
java.util.concurrent.Callable ?
-
这里有Callable的使用教程:blogs.oracle.com/CoreJavaTechTips/entry/get_netbeans_6
标签: java android asynchronous callable