Welcome to the Joint-Venture Blog from Fabio Cortesi and Stefan Jäger.
06.08.2008 - Stefan Jäger
Today, I had the problem to iterate backwards in a ArrayList. Didn’t know, there is a ListIterator:
List<string> theList = new ArrayList<string>(); theList.add("a"); theList.add("b"); theList.add("c"); ListIterator<string> liter = theList.listIterator(theList.size()); while (liter.hasPrevious()) { System.out.println(liter.previous()); }
Comments
Leave a comment