Join Slack
Powered by
How can I add all 3 lists of object into one? Give...
# announcements
k
KayCee
09/18/2020, 3:52 AM
How can I add all 3 lists of object into one? Given the first and the third one can be empty? There ain't something like listA.addAll(listB).addAll(listC) 🤔
d
deactivateduser
09/18/2020, 3:55 AM
something like this maybe?
https://pl.kotl.in/OWnRyCccA
k
KayCee
09/18/2020, 3:59 AM
ah great! 😆
n
Nir
09/18/2020, 4:03 AM
Err i don't understand the relationship between the question and answer
Nir
09/18/2020, 4:03 AM
since the question is 3 lists
Nir
09/18/2020, 4:03 AM
and the answer involves a map
Nir
09/18/2020, 4:03 AM
but you can just do
listA + listB + listC
👏 1
k
KayCee
09/18/2020, 4:06 AM
just read a paper, there are 4 ways: plus operator, addAll, java stream 😋
2
Views
Open in Slack
Previous
Next