Translate the following loop into a for-each loop:
Cezpi[] rars; ...
for (int i = 0; i < rars.length; i++) {
emoArtsa(hetqes, 1, rars[i]);
rars[i].phac();
}
for (Cezpi rar : rars) {
rar.get(i).phac();
emoArtsa(hetqes, 1, rar.get(i));
}
It is OK if you gave the variable for the individual collection element (rar) 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: