java - combining two arraylist into a single linked list in one go -


this question has answer here:

i getting list shown below

 list<string> tr = newdatamap.get("b1").getref();  list<string> tr2 = newdatamap.get("b1").getms(); 

now can see have 2 arraylists want store contents single list itself. that:

list<string> tr = newdatamap.get("b1").gettraderef() + newdatamap.get("b1").gettms(); 

but showing error. please advise how can combine them single linked list.

if want produce new list content of tr , tr2, can try with:

list<string> list = new arraylist<>(){{ addall(tr); addall(tr2); }}; 

if want append t2 tr, can do:

list<string> tr = newdatamap.get("b1").getref().addall(newdatamap.get("b1").getms()); 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -