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 › list-add-method-in-java-with-examples
List add() Method in Java with Examples - GeeksforGeeks
July 11, 2025 - How to add an element at a specific index in a list in Java using the add(int I, Element E) method.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › util › List.html
List (Java Platform SE 8 )
October 20, 2025 - The List interface places additional ... add, remove, equals, and hashCode methods. Declarations for other inherited methods are also included here for convenience. The List interface provides four methods for positional (indexed) access to list elements. Lists (like Java arrays) are ...
🌐
BeginnersBook
beginnersbook.com › 2013 › 12 › java-arraylist-add-method-example
Java ArrayList add() Method Example
September 17, 2022 - The reason the following program throws IndexOutOfBoundsException is: The ArrayList grows in size dynamically, you cannot add third element in the ArrayList without adding the second element, which is what we are trying to do in the following program. import java.util.ArrayList; public class JavaExample{ public static void main(String[] args){ ArrayList<String> list = new ArrayList<>(); list.add(0, "Hi"); // ["Hi"] list.add(0, "Hello");// ["Hello", "Hi"] // throws IndexOutOfBoundsException list.add(3, "Bye"); } }
🌐
Baeldung
baeldung.com › home › java › java collections › add multiple items to an java arraylist
Add Multiple Items to an Java ArrayList | Baeldung
January 8, 2024 - List<Integer> list = new ArrayList<>(); Integer[] otherList = new Integer[] {1, 2, 3, 4, 5}; Collections.addAll(list, otherList); Similarly to the way explained in the above section, the contents of both lists here will refer to the same objects.
🌐
Jenkov
jenkov.com › tutorials › java-collections › list.html
Java List
February 29, 2020 - By default you can put any Object into a List, but from Java 5, Java Generics makes it possible to limit the types of object you can insert into a List. Here is an example: ... This List can now only have MyObject instances inserted into it. You can then access and iterate its elements without casting them. Here is how it looks: List<MyObject> list = new ArrayList<MyObject>(); list.add(new MyObject("First MyObject")); MyObject myObject = list.get(0); for(MyObject anObject : list){ //do someting to anObject...
🌐
DigitalOcean
digitalocean.com › community › tutorials › java-list-add-addall-methods
How To Use add() and addAll() Methods for Java List | DigitalOcean
September 10, 2025 - Optimized implementations: ArrayList can pre-allocate space for bulk additions ... package com.journaldev.examples; import java.util.*; import java.util.stream.Collectors; public class ListAddAllExamples { public static void main(String[] args) { // Example 1: Basic addAll() operations List<Integer> primeNumbers = new ArrayList<>(); primeNumbers.addAll(Arrays.asList(2, 7, 11)); System.out.println("After adding [2, 7, 11]: " + primeNumbers); primeNumbers.addAll(1, Arrays.asList(3, 5)); System.out.println("After inserting [3, 5] at index 1: " + primeNumbers); // Example 2: Performance comparison
Find elsewhere
🌐
iO Flood
ioflood.com › blog › java-list-add
Adding Elements to a List in Java: A How-To Guide
February 27, 2024 - In this example, we create a new ArrayList and use the add() method to insert the string ‘Hello’ into the list. The output shows that the list now contains one element: ‘Hello’. This is a basic way to use the add() method in Java, but ...
🌐
W3Schools
w3schools.com › java › java_arraylist.asp
Java ArrayList
It is part of the java.util package and implements the List interface. The difference between a built-in array and an ArrayList in Java, is that the size of an array cannot be modified (if you want to add or remove elements to/from an array, you have to create a new one).
🌐
Coderanch
coderanch.com › t › 682316 › java › adding-List
adding to a List (Beginning Java forum at Coderanch)
July 19, 2017 - Instead, it returns a special implementation of interface List that reflects what is in the array that you created the list from. This special implementation of List does not allow elements to be added to it - that's why you get an UnsupportedOperationException when you try to call the add(...) method on it.
🌐
W3Schools
w3schools.com › java › ref_arraylist_add.asp
Java ArrayList add() Method
T refers to the data type of items in the list. ... import java.util.ArrayList; public class Main { public static void main(String[] args) { ArrayList<String> cars = new ArrayList<String>(); cars.add("Volvo"); cars.add("BMW"); cars.add("Ford"); cars.add("Mazda"); cars.add(2, "Toyota"); System.out.println(cars); } }
🌐
Thospfuller
thospfuller.com › home › tutorials › java code examples › tutorial: quickly add elements to a list in java! 🚚
Tutorial: Learn how to add elements to a Java List now! 🚚
May 27, 2025 - Use the add and addAll methods to add elements in LinkedList in Java. An index can be used in both the add and addAll methods to indicate where in the list the element(s) should be appended.
🌐
GeeksforGeeks
geeksforgeeks.org › java › list-interface-java-examples
List Interface in Java - GeeksforGeeks
To update an element in a list, use the set() method with the target index and the new value. Since List is indexed, the element is replaced at the specified position. ... import java.util.*; class Geeks { public static void main(String args[]) ...
Published   1 month ago
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › util › ArrayList.html
ArrayList (Java Platform SE 8 )
October 20, 2025 - The size, isEmpty, get, set, iterator, and listIterator operations run in constant time. The add operation runs in amortized constant time, that is, adding n elements requires O(n) time. All of the other operations run in linear time (roughly speaking).
🌐
Vultr
docs.vultr.com › java › standard-library › java › util › ArrayList › add
Java ArrayList add() - Add Element | Vultr Docs
November 29, 2024 - Use the add() method to append an element at the end of the list. ... import java.util.ArrayList; public class Main { public static void main(String[] args) { ArrayList<String> fruits = new ArrayList<>(); fruits.add("Apple"); fruits.add("Banana"); ...
🌐
Quora
quora.com › How-can-we-add-elements-to-the-end-of-an-ArrayList-without-using-any-extra-space-Java
How can we add elements to the end of an ArrayList without using any extra space (Java)? - Quora
Answer: Uhh…how, exactly, do you store more data without using extra space? If you are expressing concern about how the Java array class manages performance by adding unused space at the end of the array, consider several options * Don’t use Java. Use a language that does not waste space, ...
🌐
TutorialsPoint
tutorialspoint.com › home › java/util › java arraylist add() method with index
Java ArrayList add() Method with Index
September 1, 2008 - The following example shows the ... capacity ArrayList<Integer> arrlist = new ArrayList<Integer>(5); // use add() method to add elements in the list arrlist.add(15); arrlist.add(22); arrlist.add(30); arrlist.add(40); // adding ...