ListIterator
Wednesday, 22 June 2011
import java.util.*;
public class ListIteratorDemo {
public static void main(String[] args) {
LinkedList l=new LinkedList();
l.add("sharukh");
l.add("aamir");
l.add("salman");
ListIterator li=l.listIterator();
while(li.hasNext()){
System.out.println(li.next());
}
while(li.hasPrevious()){
System.out.println(li.previous());
}
}
}
Read more...
public class ListIteratorDemo {
public static void main(String[] args) {
LinkedList l=new LinkedList();
l.add("sharukh");
l.add("aamir");
l.add("salman");
ListIterator li=l.listIterator();
while(li.hasNext()){
System.out.println(li.next());
}
while(li.hasPrevious()){
System.out.println(li.previous());
}
}
}