Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java iterator index

List<String> list = Arrays.asList("zero", "one", "two");

ListIterator<String> iter = list.listIterator();
    
while (iter.hasNext()) {
    System.out.println("index: " + iter.nextIndex() + " value: " + iter.next());
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #iterator #index
ADD COMMENT
Topic
Name
4+7 =