Skip to content

Instantly share code, notes, and snippets.

@anjanashankar9
Created January 20, 2021 06:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anjanashankar9/b85e1e11daec83128a33c6fad68a9253 to your computer and use it in GitHub Desktop.
Save anjanashankar9/b85e1e11daec83128a33c6fad68a9253 to your computer and use it in GitHub Desktop.
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