//泛型,为什么用iterator迭代器,需要进行强转?
public void testItrater(){ Iterator it = course.iterator(); while(it.hasNext()){ Course cr = (Course) it.next(); System.out.println(cr.id+" "+cr.name); } }
public void testItrater(){ Iterator it = course.iterator(); while(it.hasNext()){ Course cr = (Course) it.next(); System.out.println(cr.id+" "+cr.name); } }
2018-10-21
举报