JAVA 类集框架 ArrayList

import java.util.ArrayList;

public class Test {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        ArrayList<String> arrayList = new ArrayList<String>();
        arrayList.add("1");
        arrayList.add("2");
        arrayList.add("3");

        for (int i = 0; i < arrayList.size(); i++) {
            String s = arrayList.get(i);
            System.out.println(s);
        }
    }

}

运行结果

1
2
3
posted @ 2020-09-06 22:11  thomas_blog  阅读(119)  评论(0编辑  收藏  举报