Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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

like image 831
user47055 Avatar asked Dec 17 '08 13:12

user47055


People also ask

How do you append a list at the end of another list in Java?

You would use: books2. addAll(books); to append all entries in books to books2 .

Can you append a list to another list?

To append a list to another list, use extend() function on the list you want to extend and pass the other list as argument to extend() function. In this tutorial, we shall learn the syntax of extend() function and how to use this function to append a list to other list.

Does append add to the end of a list?

append() method adds the entire item to the end of the list. If the item is a sequence such as a list, dictionary, or tuple, the entire sequence will be added as a single item of the existing list.

Which method adds one list at the end of another list?

The append() method adds a single element towards the end of a list.


1 Answers

List.addAll()

like image 104
Rob Avatar answered Oct 24 '22 06:10

Rob