Collection, and therefore also List, has a method called addAll to add all elements of any other collection in one go. For List, addAll will add all those elements at the end. So just create a new List, and call addAll for all Lists whose contents need to be added.

. . . and Lists retain insertion order as a default behaviour. You would have to look in the documentation for addAll to see which order it adds in. It says in the Java™ Tutorials that addAll concatenates Lists.

Amit K Jain
Ranch Hand

Joined: Nov 06, 2008
Posts: 55

posted Aug 26, 2011 03:32:04

0

Ahh! It was so quick and easy.

Thank you all

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 44016

33

posted Aug 26, 2011 04:02:16

0

You're welcome

You spend hours and hours designing the List classes, and once you have got them working, they become really easy to use.

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com