Example & Tutorial understanding programming in easy ways.

Simple Example of ListIterator Interface in Java .

import java.util.*;

class Test2{

public static void main(String args[]){

ArrayList al=new ArrayList();

al.add("Hello");

al.add("My");

al.add("java");

ListIterator itr=al.listIterator();

System.out.println("traversing elements in forward direction");

while(itr.hasNext()){

System.out.println(itr.next());

}

System.out.println("traversing elements in backward direction");

while(itr.hasPrevious()){

System.out.println(itr.previous());

} } }

Output: traversing elements in forward direction
Hello
My
java
traversing elements in backward direction
java
My
Hello

Read More →
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!