Java List Clone clone(List list)

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

Description

clone

License

Open Source License

Declaration

public static List<String> clone(List<String> list) 

Method Source Code

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

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

public class Main {
    public static List<String> clone(List<String> list) {
        if (list == null) {
            return null;
        }/*from www . j a v a2 s .c om*/
        List<String> newList = new ArrayList<String>();

        for (int i = 0, k = list.size(); i < k; i++) {
            newList.add(list.get(i));
        }
        return newList;
    }
}

Related

  1. clone(final List list)
  2. clone(List in)
  3. clone(List> doc)
  4. clone(List list)
  5. clone(List input)
  6. cloneAdd(final List list, final E... element)
  7. CloneList(final Collection list)
  8. cloneList(final List l, final int n)

  9. HOME | Copyright © www.java2s.com 2016