E.g.
for(String str : list1) { ... } for(String str : list2) { ... }
suppose we are sure that list1.size() equals list2
list1.size()
list2
As you say that both the list are of same size, then you can use "for" loop instead of "for-each" loop. You can use get(int index) method of list to get the value during each iteration.