【泛型:ArrayListDemo】

package com.yjf.esupplier.common.test;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * @author shusheng
 * @description
 * @Email shusheng@yiji.com
 * @date 2018/12/13 10:04
 */
public class ArrayListDemo {

    public static void main(String[] args) {
        ArrayList<String> array = new ArrayList<String>();
        array.add("hello");
        array.add("world");
        array.add("java");

        Iterator it = array.iterator();
        while(it.hasNext()){
            System.out.println(it.next());
        }
    }

}

 

posted @ 2019-07-31 11:09  书丶生  阅读(140)  评论(0编辑  收藏  举报