Java List Create createList(Object... objs)

Here you can find the source of createList(Object... objs)

Description

create List

License

Open Source License

Declaration

@SuppressWarnings("rawtypes")
    public static List<?> createList(Object... objs) 

Method Source Code


//package com.java2s;
import java.util.ArrayList;

import java.util.List;

public class Main {
    @SuppressWarnings("rawtypes")
    public static List<?> createList(Object... objs) {
        return createList(new ArrayList(), objs);
    }//from   ww  w. j av a 2  s . c  om

    @SuppressWarnings({ "rawtypes", "unchecked" })
    public static List<?> createList(List list, Object... objs) {
        if (objs != null) {
            for (Object obj : objs) {
                list.add(obj);
            }
        }
        return list;
    }
}

Related

  1. createList(E initialElement)
  2. createList(final T object)
  3. createList(final T... elements)
  4. createList(List list)
  5. createList(Object... entries)
  6. createList(Object[] values)
  7. createList(String s)
  8. createList(T value, int n)
  9. createList(T... _entries)