In Java 8:

List<String> newList = Stream.concat(listOne.stream(), listTwo.stream())
                             .collect(Collectors.toList());

Java 16+:

List<String> newList = Stream.concat(listOne.stream(), listTwo.stream()).toList();
Answer from Dale Emery on Stack Overflow
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ java โ€บ java-program-to-concatenate-two-list
Java Program to Concatenate Two List - GeeksforGeeks
July 23, 2025 - ... // Java Program to Concatenate Two List // using addAll() method import java.io.*; import java.util.ArrayList; import java.util.List; public class GFG { public static void main(String[] args) { // given list 1 List<Integer> list1 = new ...
๐ŸŒ
DigitalOcean
digitalocean.com โ€บ community โ€บ tutorials โ€บ merge-two-lists-in-java
How to Merge Two Lists in Java? | DigitalOcean
Technical tutorials, Q&A, events โ€” This is an inclusive place where developers can find or lend support and discover new ways to contribute to the community.
๐ŸŒ
Blogger
javarevisited.blogspot.com โ€บ 2013 โ€บ 08 โ€บ -example-to-merge-or-join-multiple-List-in-Java.html
2 Example to Merge or Join Multiple List in Java - Tutorial
There are two main ways to merge, join or combine two List in Java, by using addAll(Collection c) method or by using ListUtils union method from Apache commons Collection. In this Java tutorial, we will see examples of both approaches.
๐ŸŒ
How to do in Java
howtodoinjava.com โ€บ home โ€บ collections framework โ€บ java arraylist โ€บ merge two arraylists in java, with or without duplicates
Merge Two ArrayLists in Java, With or Without Duplicates
January 19, 2023 - Merge two ArrayLists in Java with addAll() or Stream.concat(), drop duplicates with LinkedHashSet, merge sorted lists and merge objects by key.
๐ŸŒ
Scaler
scaler.com โ€บ home โ€บ topics โ€บ java program to merge two lists
Java Program to Merge Two Lists | Scaler Topics
June 9, 2024 - We can merge two lists in Java using the union() method. It returns a new concatenated list after receiving two list arguments.
๐ŸŒ
Baeldung
baeldung.com โ€บ home โ€บ java โ€บ java collections โ€บ java โ€“ combine multiple collections
Java - Combine Multiple Collections | Baeldung
May 11, 2024 - Of course the simplest solution for combining collections is using the addAll() method, as in the following List example, however it is worth noting that this method creates a new collection with additional references to the same objects that are in the first two collections:
๐ŸŒ
Vultr Docs
docs.vultr.com โ€บ java โ€บ examples โ€บ join two lists
Java Program to Join Two Lists
December 16, 2024 - Ensure you have two lists to combine. Use Stream.concat() from Java 8 to merge the streams of both lists, then collect results into a new list.
Find elsewhere
๐ŸŒ
Educative
educative.io โ€บ answers โ€บ how-to-merge-two-lists-in-java
How to merge two lists in Java
In this shot, we have seen how to merge two lists in Java by using the addAll() method and Java Stream.
๐ŸŒ
Programiz
programiz.com โ€บ java-programming โ€บ examples โ€บ merge-two-lists
Java Program to Merge two lists
import java.util.ArrayList; import java.util.List; class Main { public static void main(String[] args) { // create first list List<Integer> prime = new ArrayList<>(); prime.add(2); prime.add(3); prime.add(5); System.out.println("First List: " + prime); // create second list List<Integer> even = new ArrayList<>(); even.add(4); even.add(6); System.out.println("Second List: " + even); // create merged list List<Integer> numbers = new ArrayList<>(); numbers.addAll(prime); numbers.addAll(even); System.out.println("Merged List: " + numbers); } }
๐ŸŒ
Baeldung
baeldung.com โ€บ home โ€บ java โ€บ java collections โ€บ java map โ€บ combining two lists into a map in java
Combining Two Lists Into a Map in Java | Baeldung
June 27, 2025 - We then iterate through each element in KEY_LIST using a for loop, and for each element, we retrieve the corresponding element from VALUE_LIST using the same index i. Then, the put() method fills the key-value pair into the result map. Stream API provides many concise and efficient ways to manipulate Java collections. So next, letโ€™s use the Java Stream API to associate two lists:
๐ŸŒ
Vultr Docs
docs.vultr.com โ€บ java โ€บ examples โ€บ merge-two-lists
Java Program to Merge two lists | Vultr Docs
December 16, 2024 - This code initially creates two lists, list1 and list2, and then merges them into mergedList. The addAll() method from the ArrayList class is used to add all elements from list2 to mergedList which already contains the elements from list1. The Stream API, introduced in Java 8, offers a more functional approach to handle collections.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ java-program-to-concatenate-two-list
Java program to combine two list by alternatively taking elements
May 31, 2024 - The Java program to combine two lists by alternatively taking elements is a simple code snippet that takes in two lists of any type of object that can be stored in a list and returns a new list that contains elements from both input lists alternately.
๐ŸŒ
Programiz
programiz.com โ€บ java-programming โ€บ examples โ€บ join-two-lists
Java Program to Join Two Lists
In the above program, we used union() method to join the given lists to joined. import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; public class JoinLists { public static void main(String[] args) { List<String> list1 = new ...
๐ŸŒ
Quora
quora.com โ€บ How-do-you-combine-multiple-lists-in-Java
How to combine multiple lists in Java - Quora
Answer (1 of 4): Java 8 Stream API provides a couple of different options to join multiple lists. 1. 1. Joining List Using Java 8 Stream flatMap method In case we have a number of lists, we can use [code ]flatMap()[/code] method to join multiple lists in Java.flatMap method will return a Stream...
๐ŸŒ
Codemia
codemia.io โ€บ home โ€บ knowledge hub โ€บ how do i join two lists in java?
How do I join two lists in Java? | Codemia
January 2, 2025 - The addAll() method is part of the List interface and is used to append all elements from one list to another. It ensures that the elements are added in the order they appear in the source list.
๐ŸŒ
Techie Delight
techiedelight.com โ€บ home โ€บ java โ€บ join two lists in java
Join two lists in Java | Techie Delight
July 7, 2026 - Here weโ€™re obtaining a stream consisting of elements from both the list using the static factory method Stream.of() and accumulating all elements into a new list using a Collector. ... We can avoid using a collector by accumulating all elements using forEach() instead, as shown below: ... The Java Stream provides concat() that takes two streams as input and creates a lazily concatenated stream whose elements are all the elements of the first stream, followed by all the elements of the second stream.
๐ŸŒ
Coderanch
coderanch.com โ€บ t โ€บ 696394 โ€บ java โ€บ Combining-lists-Java
Combining lists using Java 8 (Features new in Java 8 forum at Coderanch)
July 9, 2018 - Piet Souris wrote:Indeed, and I don't think that ListZip class is simple. For instance So, in twoLists we have that A is List and B is List. However, the zip method takes a List<A> and a List<B> as parameters. Very confusing. But take note that the generic A and B from ListZip are not the same as the generic A and B from the zip method!
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ java โ€บ java-program-to-combine-two-list-by-alternatively-taking-elements
Java Program to Combine Two List by Alternatively Taking Elements - GeeksforGeeks
August 8, 2022 - List1 contents: Geeks Geeks portal List2 contents: for is CSE portal Merged List contents: Geeks for Geeks is CSE portal portal ... // Java Program to Combine Two List // by Alternatingly Taking Elements // importing required packages import java.io.*; import java.util.*; import java.util.Iterator; // Class class GFG { // Main driver method public static void main(String[] args) { // Creating(declaring) List1 List<Integer> list1 = new ArrayList<Integer>(); // Adding elements to List1 // Custom inputs list1.add(2); list1.add(4); list1.add(6); // Creating(declaring) List2 List<Integer> list2 = n