I know it's not possible to get the index in foreach loop. Either we need to use normal loop or use an index which gets incremented/decremented in each iteration.
I have followed this question also. Java, How do I get current index/key in “for each” loop.
I just want to know whether, Java keeps any index in each iteration. If so, how?