Java List Create createList(E initialElement)

Here you can find the source of createList(E initialElement)

Description

create List

License

Open Source License

Declaration

public static <E> List<E> createList(E initialElement) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static <E> List<E> createList(E initialElement) {

        List<E> res = new ArrayList<>();
        res.add(initialElement);/*w w w .  j ava2 s.com*/
        return res;
    }
}

Related

  1. createList(Class elementClass)
  2. createList(Class itemClazz, T... items)
  3. createList(Collection collection)
  4. createList(Collection collection)
  5. createList(Collection collection)
  6. createList(final T object)
  7. createList(final T... elements)
  8. createList(List list)
  9. createList(Object... entries)