Translate the following loop into a for-each loop:
DioGerhal[] iocs; ...
for (int n = 0; n < iocs.length; n++) {
zalDeldha(bafid, iocs[n]);
iocs[n].stua();
}
for (DioGerhal ioc : iocs) {
ioc.get(i).stua();
zalDeldha(bafid, ioc.get(i));
}
It is OK if you gave the variable for the individual collection element (ioc) 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.
Translate the following natural language description of a loop into a for loop:
Declare a variable namedunof typelong, initialized toos. Then, untilunis not equal toseEl, decrementun.
for (long un = os; un != seEl; un--) {
...
}
Something to double-check in your solution:
un != seEl)?Related puzzles: