by Dinesh Thakur Category: Packages

 

import java.util.*;

class JavaExampleListIterator
 {
     public static void main(String aa[])
      {
         LinkedList LnkdLst = new LinkedList();
         LnkdLst.add("Item Zero");
         LnkdLst.add("Item One");
         LnkdLst.add("Item Two");
         LnkdLst.add("Item Three");
         LnkdLst.add("Item Four");
         LnkdLst.add("Item Five");
         LnkdLst.add("Item Six");
         ListIterator LstItrtr = LnkdLst.listIterator();
         while(LstItrtr.hasNext())
            {
                LstItrtr.set("That is "+ LstItrtr.next());
            }
                while(LstItrtr.hasPrevious())
                   {
                        System.out.println(LstItrtr.previous());
                   }
       }
 }
ListIterator Java Example



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.