public void testIterator(){ Set<Course> set = new HashSet<Course>(); Iterator<Course> it = set.iterator(); System.out.println("通过Iterator遍历"); while(it.hasNext()){ // System.out.println(it.hasNext()); // System.out.println("....."); System.out.println(it.next()); } }
set里面没有内容