List: listIterator() : List « java.util « Java by API






List: listIterator()

  
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;

public class Main {
  public static void main(String[] a) {
    List<String> list = new LinkedList<String>();
    list.add("A");
    list.add("B");
    list.add("C");
    list.add("D");

    ListIterator iter = list.listIterator();
    while (iter.hasNext()) {
      System.out.println(iter.next());
    }

  }
}

   
    
  








Related examples in the same category

1.List: add(T e)
2.List: addAll(Collection c)
3.List: clear()
4.List: clone()
5.List: contains(Object o)
6.List: equals(Object o)
7.List: get(int index)
8.List: isEmpty()
9.List: iterator()
10.List: lastIndexOf(Object o)
11.List: remove(int index)
12.List: remove(Object o)
13.List: removeAll(Collection c)
14.List: retainAll(Collection c)
15.List: set(int index, T element)
16.List: subList(int fromIndex, int toIndex)
17.List: toArray(T[] a)