标签:iterator str new while public [] import string ati
package com.yjf.esupplier.common.test; import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; /** * @author shusheng * @description * @Email shusheng@yiji.com * @date 2018/12/12 17:11 */ public class ArrayListDemo2 { public static void main(String[] args) { ArrayList array = new ArrayList(); array.add("hello"); array.add("world"); array.add("world"); array.add("world"); array.add("java"); array.add("java"); array.add("hello"); array.add("hello"); array.add("software"); HashSet hs = new HashSet(); hs.addAll(array); Iterator it = hs.iterator(); while(it.hasNext()){ System.out.println(it.next()); } } }
标签:iterator str new while public [] import string ati
原文地址:https://www.cnblogs.com/zuixinxian/p/10340840.html