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

gcc - MinGW's ld cannot perform PE operations on non PE output file -

How to connect android app to App engine -

hadoop - Running Map Reduce Job shows error - Mkdirs failed to create /var/folders/ -