Java List Prepend prependInList(T el, T[] array)

Here you can find the source of prependInList(T el, T[] array)

Description

prepend In List

License

Open Source License

Declaration

public static <T> List<T> prependInList(T el, T[] array) 

Method Source Code

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

import java.util.ArrayList;

import java.util.Collections;

import java.util.List;

public class Main {
    public static <T> List<T> prependInList(T el, T[] array) {
        List<T> result = new ArrayList<>(array.length + 1);
        result.add(el);/*from  w  w w . j a v a 2s .  c o m*/
        Collections.addAll(result, array);
        return result;
    }
}

Related

  1. prepend(List list, E e)
  2. prepend(List list, int minCapacity, E... items)
  3. prepend(String clang, List args)
  4. prepend(String prefix, List strings)
  5. prepend(String start, List suggestions)
  6. prependToList(A elem, List list)