标签:png 继承 ring pack int src oid style pac
package 集合;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.TreeMap;
public class Map {
public static void main(String[] args) {
List<String> allList = null;
Collection<String> allCollection = null;
allList = new ArrayList<>();
allCollection = new ArrayList<>();
allList.add("Hello");//从Collection继承的方法
allList.add(0,"World");//此方法为List扩充的方法,指定位置添加
System.out.println(allList);
allCollection.add("www.baidu.com");
allList.addAll(allCollection);//从Collection继承的方法,增加一组对象
allList.addAll(0, allCollection);//此方法是List自定义的指定位置增加一组对象
System.out.println(allList);
}
}
标签:png 继承 ring pack int src oid style pac
原文地址:https://www.cnblogs.com/wangffeng293/p/14244991.html