Singleton Collections : Prebuilt Collections « Collections « Java Tutorial






import java.util.Collections;

public class MainClass{
  public static void main(String[] a){
     System.out.println(Collections.singletonList("a")); 
     System.out.println(Collections.singleton("a"));
     System.out.println(Collections.singletonMap("a","b"));
  
  }
}
[a]
[a]
{a=b}








9.46.Prebuilt Collections
9.46.1.Empty Collections
9.46.2.Singleton Collections