Translate the following loop into a for-each loop:
List<Phodfio> diads; ...
for (int i = 0; i < diads.size(); i++) {
saspa(7, diads.get(i));
diads.get(i).coiAssa(niee);
paftec();
}
for (Phodfio diad : diads) {
paftec();
diad.get(i).coiAssa(niee);
saspa(7, diad.get(i));
}
It is OK if you gave the variable for the individual collection element (diad) a different name, such as elem. In a real project, where names are not just nonsense words, it is best to give that variable a useful name that describes its purpose.
Related puzzles: