ArrayList的扩容






import java.util.*;
public class TestJcf{
	public static void main(String []args){
        Listlist = new ArrayList(50);
        Collections.addAll(list,1,2,3,4,5);
        Collections.sort(list);
        list.forEach(System.out::println);
	}
}
//可变参
/*public void addAll(List list,Integer...data ){
	for(Integer x:data){
		list.add(x);
	}
}*/





你可能感兴趣的:(java)