greetings all i am using an Iterator to iterate through collection and i want to get the current loop index any ideas how to do that ?
+1
A:
What kind of collection? If it's an implementation of the List interface then you could just use (it.nextIndex()-1).
Zenzen
2010-07-25 15:59:54
A:
Use a ListIterator to iterate through the Collection. If the Collection is not a List to start with use Arrays.asList(Collection.toArray()) to turn it into a List first.
Jatin
2010-07-26 02:18:16