java - How to prepare list which contains list objects? -


i fetching records database , value this

1,"a" 1,"b" 2,"c" 3,"d" 3,"e" 4,"f" 

here got result resultset want prepare list like

[[a,b],[c],[d.e],[f]] 

any 1 can me how solve this, tried list , map concept getting last list object only. thanks

you need use map, use integer key, , list<string> value. perform check each key encountered map contains list (empty or otherwise). if doesn't first add list, append value list.

you investigate multimaps


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -