Collections.emptyList() does not need to create a new object for each call; it's typical, as in OpenJDK, to just return the singleton EMPTY_LIST object. Additionally, it's clearer that you intend to mean an empty list rather than having forgotten to fill in a placeholder.

Use emptyList(); it's both faster (up to Java target level 1.9) and more readable.

Answer from chrylis -cautiouslyoptimistic- on Stack Overflow
🌐
Baeldung
baeldung.com › home › java › java collections › collections.emptylist() vs. new list instance
Collections.emptyList() vs. New List Instance | Baeldung
April 4, 2025 - Collections.emptyList() returns a list (java.util.Collections.EmptyList) that can’t be modified. When creating a new list instance you can modify it depending on the implementation: @Test public void givenArrayList_whenAddingElement_addsNewElement() { List<String> mutableList = new ArrayList<>(); mutableList.add("test"); assertEquals(mutableList.size(), 1); assertEquals(mutableList.get(0), "test"); } @Test(expected = UnsupportedOperationException.class) public void givenCollectionsEmptyList_whenAdding_throwsException() { List<String> immutableList = Collections.emptyList(); immutableList.add
🌐
TutorialsPoint
tutorialspoint.com › java › util › collections_emptylist.htm
Java Collections emptyList() Method
The Java Collections emptyList() method is used to get the empty list. List is immutable and cannot be modified.
🌐
Medium
medium.com › @rahul.tpointtech12 › java-create-empty-lists-a-step-by-step-guide-5c34f03228b3
Java Create Empty Lists: A Step-by-Step Guide | by Rahul | Medium
March 22, 2025 - So, the next time you’re working on a Java project and need to initialize an empty list, remember to leverage the power of ArrayList. ArrayList is a commonly used implementation of the List interface in Java. To create an empty ArrayList, follow these simple steps:
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-collections-emptylist-method-with-examples
Java Collections emptyList() Method with Examples - GeeksforGeeks
August 4, 2026 - ... import java.util.*; public class GFG { public static void main(String[] args) { // Create an immutable empty list List<String> list = Collections.emptyList(); // Display the list System.out.println("Empty List: " + list); // Check its size ...
🌐
JavaBeat
javabeat.net › collections-emptylist-method-in-java
Collections emptyList() Method in Java
December 31, 2023 - emptyList() is a built-in static method of the Java Collections class. This method doesn’t accept any parameter. It creates an empty and immutable List. It is a type-safe way of creating a list without explicitly creating a new instance of an empty List.
Find elsewhere
🌐
Python Examples
pythonexamples.org › java › how-to-create-an-empty-list
How to create an Empty List in Java
To create an empty list in Java, you can use the Collections.emptyList method for an immutable list or the new ArrayList() constructor for a mutable list.
🌐
Blogger
javahungry.blogspot.com › 2022 › 03 › java-initialize-empty-collection.html
Java initialize empty collection | Java Hungry
The java.util.Collections class provide utility methods such as emptyList(), emptySet(), and emptyMap() and three different static final fields such as EMPTY_LIST, EMPTY_SET, and EMPTY_MAP for creating empty List, Set and Map. Read Also: How to Print ArrayList in Java There are 3 ways by which we can achieve our goal: 1.
🌐
Educative
educative.io › answers › how-to-get-an-empty-collection-in-java
How to get an empty collection in Java
This shot covers how to return ... map in Java. The Collections class contains the following static constants that give an empty collection. The collections attached to these constants have no type and are immutable in nature. Collections.EMPTY_LIST: returns an empty list. Collections.EMPTY_SET: returns an empty set. Collections.EMPTY_MAP: returns an empty map. In the following code, we create empty collections ...
🌐
ZetCode
zetcode.com › java › collections-emptylist
Java Collections.emptyList - Complete Tutorial with Examples
It's part of Java's Collections utility class since Java 1.5. Empty lists are useful as return values, default values, or placeholders. The returned list is type-safe and serializable. It cannot be modified, throwing UnsupportedOperationException on modification attempts. Collections.emptyList provides a shared immutable empty list instance. It's more efficient than creating new empty ArrayList instances.
🌐
TutorialKart
tutorialkart.com › java › java-create-empty-arraylist
How to Create an Empty ArrayList in Java?
December 21, 2020 - To create an Empty ArrayList in Java, you can use new keyword and ArrayList constructor with no arguments passed to it.
🌐
Jug
jug.bg › 2010 › 07 › using-of-collections-emptylist-the-right-way-in-java-1-5
Using of Collections.emptyList() the right way in Java 1.5+ | BG-JUG – Java Bulgarian User Group
COMPILE TIME ERROR: why ? because emptyList invoked like that means List of Objects not List of String. The other thing is that you cannot cast to List<String> because you cannot cast List<Object> to List<String>. Answer 4: You know that there is Collections.emptyList() AND YOU KNOW THAT IT RETURNS List<T> so your answer is:
🌐
Kode Java
kodejava.org › how-do-i-create-an-empty-collection-object
How do I create an empty collection object? - Learn Java by Examples
May 14, 2023 - List<String> strings = Collections.emptyList(); System.out.println("strings.size = " + strings.size()); Set<Long> longs = Collections.emptySet(); System.out.println("longs.size() = " + longs.size()); Map<String, Date> dates = Collections.emptyMap(); ...
🌐
Baeldung
baeldung.com › home › java › java array › null array to empty list in java
Null Array to Empty List in Java | Baeldung
April 7, 2025 - Here, we’ll return an empty array if the original array is null before converting the array to a list. Both approaches above safely return a List of Strings with a single expression. Before Java 8, we can also use a simple ternary operator to check for null and return an empty List when our array is null:
🌐
Programming Idioms
programming-idioms.org › idiom › 260 › create-an-empty-list-of-strings › 5405 › java
Create an empty list of strings, in Java
Create a new list · Get list size · Print list · Cheatsheets · Issues · Report a bug · × · Java · List<String> list = new ArrayList<>(); Clojure · (def items '()) C++ std::vector<std::string> items; C# var items = Enumerable.Empty<string>(); C# var items = new List<string>(); Dart ·
🌐
Python Examples
pythonexamples.org › java › how-to-create-a-list-of-empty-lists
How to create a List of Empty Lists in Java
Finally, we print the created list to the console. import java.util.ArrayList; import java.util.List; class Main { public static void main(String[] args) { List<List<String>> emptyList = new ArrayList<>(); emptyList.add(new ArrayList<>()); emptyList.add(new ArrayList<>()); emptyList.add(new ...