Java List Copy copy(List list)

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

Description

copy

License

Apache License

Declaration

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

Method Source Code

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

import java.util.*;

public class Main {
    public static <T> List<T> copy(List<T> list) {
        if (list == null) {
            return null;
        }//ww  w. j  a va2  s .  c  om
        List<T> copys = new ArrayList<T>(list.size());
        for (T t : list) {
            copys.add(t);
        }
        return copys;
    }
}

Related

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