如何使以下Java代码工作:
public class Worker implements Callable<myObject>{
@Override
public ArrayList<myObject> call() throws Exception {
ArrayList<myObject> lst_MyObjects= new ArrayList<myObject>();
return lst_MyObjects;
}
}
Run Code Online (Sandbox Code Playgroud)
错误:返回类型与Callable.call()不兼容
我只想返回一个特定类型的容器(Vector<>/ ArrayList<>等)