【泛型: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());
        }
    }

}
终身学习者
原文地址:https://www.cnblogs.com/zuixinxian/p/11275004.html