首页 > 代码库 > collections的案例

collections的案例

package ditu.com;

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

public class TestCollections {

    public static void main(String[] args) {
List<String>list=new ArrayList<String>();
Collections.addAll(list, "james","bill","ciana","dog");

List<String>l=new ArrayList<String>();
Collections.addAll(l, "张三","爸爸","大小姐");
Collections.copy(list, l);
System.out.println(list);

    }

}

 

collections的案例