+ 8
Does the addAll() differ from add()?
while adding elements to a list(an ArrayList), sometimes adding an element brings up the all phrase I didn't type, so I end up removing it, for example. in this; ArrayList<Integer> primes = new ArrayList<Integer> (); when it comes to adding elements; primes.add(3); but as I open the parenthesis, something like auto correct occurs and this comes up: primes.addAll(3); I'm always inclined to delete off the "All". does this "All" have an implication? thanks?
3 ответов
+ 4
You can use .addAll to add another whole List to your ArrayList; .add is only for single elements.
+ 5
Schindlabua
oookay.
thanks very much
+ 2
mark am in uganda too gv me yo contact so that we can connect