在我的代碼中,我有多個List<Future<something>>
實例,我想要一個方法來處理等待它們完成。但是,我得到一個編譯器異常告訴我,actual argument List<Future<Boolean>> cannot be converted to List<Future<?>>
。不能在方法參數中使用列表<Future<?>>在從不同地方調用時的方法參數
這是方法頭:
public void waitForIt(<List<Future<?>> params)
,這是它怎麼叫:
...
List<Future<Boolean>> actions = new ArrayList<Future<Boolean>>();
waitForIt(actions); <-- compiler error here
...
我需要這爲List<Future<Map<String, String>>>
和其他一些也正常工作。
List>? –
nogard
nogard:號碼不起作用。 –