Java List Copy copy(List list)

Here you can find the source of copy(List list)

Description

Returns a copy of the given list

License

Apache License

Parameter

Parameter Description
list A list containing some values

Return

A copy of the given list

Declaration

public static <T> List<T> copy(List<T> list) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;
import java.util.List;

public class Main {
    /**/*from   w  w w .  j  a  v  a 2  s . co m*/
     * Returns a copy of the given list
     * @param list A list containing some values
     * @return A copy of the given list
     */
    public static <T> List<T> copy(List<T> list) {
        return new ArrayList<T>(list);
    }
}

Related

  1. copy(List src, int offset, int length)
  2. copy(List master)
  3. copy(List source, int index)
  4. copy(List list)
  5. copy(List list)
  6. copy(List original)
  7. copy(List toCopy)
  8. copy(List toCopy)
  9. copy(List[] sourceLists, List[] destLists)