Here you can find the source of copyList(final List source, final List destination)
Parameter | Description |
---|---|
source | a parameter |
destination | a parameter |
public static synchronized void copyList(final List source, final List destination)
//package com.java2s; import java.util.List; public class Main { /**/*from w ww. jav a 2 s . c om*/ * Copy the contents of the source list to the destination list * Any items in the destination list before the copy will be removed * @param source * @param destination */ public static synchronized void copyList(final List source, final List destination) { if (source != null && destination != null) { destination.clear(); for (Object obj : source) { destination.add(obj); } } } }