Here this tutorial would help us to create an empty list with Collections class.
Source Code
package com.beginner.examples;
import java.util.Collections;
import java.util.List;
public class EmptyListExample {
public static void main(String a[]){
// use emptyList()
List list = Collections.emptyList();
System.out.println("List: " + list);
}
}
Output:
List: []
References
Imported packages in Java documentation: