集合基础
import java.util.ArrayList;
public class ArrayListDemo_1 {
public static void main(String[] args) {
ArrayList<String> arrL = new ArrayList<>();
arrL.add("helloWorld"); //追加字符串
System.out.println("arrayList:"+arrL);
arrL.add(0,"你好世界");//在0位置添加
arrL.add("java"); //在末尾追加
System.out.println("arrayList:"+arrL);
}
}
标签:java,ArrayList,arrL,System,add,集合,out
From: https://www.cnblogs.com/lg369/p/17060047.html