How to have List Iterator start at a given index?
问题 I have a linked list and I need to make method that returns an iterator at a given point in the list. I currently have an iterator that starts at the head: public Iterator<E> iterator( ) { return new ListIterator(); } All I have for the other one is: public Iterator<E> iterator(int x ) { return new ListIterator(); } I'm not sure how to go about utilizing the given position(x) that won't affect my ListIterator constructor which starts at head. I tried using a for loop to get to "x" but