I've been wondering if it is somehow possible to get the current index of a for each loop in Java without a seperate count variable.
In debug mode I can see the loop in the following structure:
i$ = {ArrayList$Itr@17838}
cursor = 1
lastRet = 0
expectedModCount = 5
this$0 = {ArrayList@17836}
So I guess cursor is the index. Is there a way to access the cursor?
Thanks for your help
So far