Here you can find the source of copy(List
Parameter | Description |
---|---|
source | a parameter |
public static List<Integer> copy(List<Integer> source, int index)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { /**/* w w w. j a va 2 s .c o m*/ * * @param source * @return */ public static List<Integer> copy(List<Integer> source, int index) { List<Integer> destination = new ArrayList<>(); for (int i = index; i < source.size(); i++) { destination.add(new Integer(source.get(i))); } return destination; } }