I wrote this code to add arraylist to my 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())));
However Eclipse gives me the error:
The method add(ArrayList<String>) in the type ArrayList<ArrayList<String>> is not applicable for the arguments (boolean)
It recommends changing add to addall but when I do so it throws this error:
The method addAll(Collection<? extends ArrayList<String>>) in the type ArrayList<ArrayList<String>> is not applicable for the arguments (boolean)
And recommends I change it to add...
Any help would be greatly appreciated
add()returns abooleanand not theArrayList.