我编写了这段代码来将 arraylist 添加到我的 2x2 arraylist
ArrayList<ArrayList<String>> addressesAndCores = new ArrayList<ArrayList<String>>();
addressesAndCores.add((new ArrayList<String>().add(remoteIp.getText())));
addressesAndCores.add((new ArrayList<String>().add(remoteIp2.getText())));
但是 Eclipse 给了我错误:
The method add(ArrayList<String>) in the type ArrayList<ArrayList<String>> is not applicable for the arguments (boolean)
它建议将 add 更改为 addall 但是当我这样做时会引发此错误:
The method addAll(Collection<? extends ArrayList<String>>) in the type ArrayList<ArrayList<String>> is not applicable for the arguments (boolean)
并建议我将其更改为添加...
任何帮助将不胜感激