Can anybody tell me how to print the index number of elements in the ArrayList using for each looping in Java.
You'll need to either iterate with an integer index, or keep a counter going.
List aList; ... int index = 0; for(kind x : aList) { ... index++; }
or
for(int index = 0; index < aList.size(); index++) { Kind x = aList.get(index) ... }