Java List Splice splice(List list1, List list2)

Here you can find the source of splice(List list1, List list2)

Description

Splices the input lists into a single list

License

Open Source License

Parameter

Parameter Description
list1 a parameter
list2 a parameter

Declaration

public static <T> List<T> splice(List<T> list1, List<T> list2) 

Method Source Code


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

import java.util.List;

public class Main {
    /**//from  ww  w  . j  a  va 2 s  .  co  m
     * Splices the input lists into a single list
     * 
     * @param list1
     * @param list2
     * 
     * @return
     */
    public static <T> List<T> splice(List<T> list1, List<T> list2) {
        List<T> outputList = new ArrayList<T>();
        outputList.addAll(list1);
        outputList.addAll(list2);
        return outputList;
    }
}

Related

  1. splice(List strings, String separator)
  2. splice(List list, int index, int deleteCount)