這個API:listIterator API描述的含義是什麼?
/// Returns a list iterator of the elements in this list (in proper sequence)
public ListIterator<E> listIterator(int index)
什麼是正確的順序的含義是什麼?
List<Integer> list = new ArrayList<Integer>();
list.add(1);
list.add(2);
list.add(3);
// Is the sequence returned by i1 and i2 is the same?
ListIterator<Integer> i1 = list.listIterator();
ListIterator<Integer> i2 = list.listIterator();
i1.next();
int result = i1.next(); // Is result 2? Or random?
請檢查您的代碼,不清楚list.next()應該做什麼 – dfa 2009-12-05 11:35:51
列表列表中沒有next()方法 – SjB 2009-12-05 11:37:35