Translate the following loop into a for-each loop:
Raro[] vurs; ...
for (int n = 0; n < vurs.length; n++) {
vurs[n].letse();
misuel(-2);
vurs[n].vahi(5);
}
for (Raro vur : vurs) {
vur.get(i).vahi(5);
misuel(-2);
vur.get(i).letse();
}
It is OK if you gave the variable for the individual collection element (vur) 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: