[Set] parse the ListIterator source (7)

Iterator allows developers to traverse the elements of a container, and operating elements.

There are two kinds of iterators Java native: Iterator and ListIterator, which ListIterator inherited from Iterator.

ListIterator some ways more than Iterator. Reverse traversal example, be set to the operating position of the elements of the last operation of the element, the Add element and the like when traversed.

ListIterator

In the description of this class, JDK official also described, iterators cursor or call index is always between elements Element method returns the previous call and call the next method returns.

In other words, the cursor does not point to the elements, while pointing between the elements!

public interface ListIterator<E> extends Iterator<E> {
    // Query Operations

    /

Guess you like

Origin blog.csdn.net/qq_26525215/article/details/104621235