Quantcast
Channel: BlogoSfera » contents
Viewing all articles
Browse latest Browse all 16

How to replace contents of arraylist with the contents of another arraylist?

$
0
0

I want to replace the contents of one arraylist with the contents of another completely. For instance, ArrayList<String> old = new ArrayList<String>(); ArrayList<String> newlist = new ArrayList<String>(); old.add("Hi"); old.add("World"); newlist.add("League") newlist.add("OfLegends"): old = newlist; When I try that, it does this odd behavior where the arraylist’s size doubles with more elements. I don’t want an […]

The post How to replace contents of arraylist with the contents of another arraylist? appeared first on BlogoSfera.


Viewing all articles
Browse latest Browse all 16

Trending Articles