user47055
user47055

Reputation: 219

How to append the contents of a list at the end of the other list?

How do I append the contents of one list at the end of another list?

Upvotes: 20

Views: 21485

Answers (3)

Sandy Shrestha
Sandy Shrestha

Reputation: 137

List finalist = a + b

Example:

List a = [1,4]
List b = [2,3]
List c = a+b

Result:

c = [1, 4, 2, 3]

Upvotes: 4

Timothy
Timothy

Reputation: 2477

listA.addAll(listB)

Upvotes: 10

Rob
Rob

Reputation: 48369

List.addAll()

Upvotes: 54

Related Questions