Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
For Loop - List Iterator
ListIterator<Integer> litr = numbers.listIterator();
while(litr.hasNext()) {
int i = litr.next();
System.out.print(i+ " ");
}
while (litr.hasPrevious()) {
int i= litr.previous();
System.out.print(i+ " ");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment