日期:2014-05-19 浏览次数:20734 次
Vector<Integer> theVector = new Vector<Integer>(); for (int i = 0; i <= 9; i++) { Integer newInteger = new Integer(i); theVector.addElement(newInteger); } ListIterator<Integer> listIt = theVector.listIterator(); while (listIt.hasPrevious()) { System.out.println(listIt.previous()); }
------解决方案--------------------
while (listIt.hasNext()){ System.out.println(listIt.next()); }
------解决方案--------------------
因为listIt.hasPrevious()返回false,没有进入while循环体