Java遍历Set集合 对 set 的遍历1.迭代遍历:Set set = new HashSet();Iterator it = set.iterator();while (it.hasNext()) { String str = it.next(); System.out.println(str);}2.for循环遍历:for (String str : set) { Java 2023-08-23 50 点赞 0 评论 75 浏览