Java List Iterator Cursor II Collection Framework II Java Tutorial for beginner with coding example
List Iterator is one of the four java cursors.
List Iterator is a bi-directional iterator. For this functionality, it has two kinds of methods:
1. Forward direction iteration
has Next This method returns true when the list has more elements to traverse while traversing in the forward direction
next This method returns the next element of the list and advances the position of the cursor.
next Index This method returns the index of the element that would be returned on calling the next() method.
2. Backward direction iteration
has Previous This method returns true when the list has more elements to traverse while traversing in the reverse direction
previous This method returns the previous element of the list and shifts the cursor one position backward.
previous Index This method returns the index of the element that would be returned on calling the previous() method.
#listIterator #javacursor
30 окт 2024