public class ForTest {
public static void main(String[] args) {
int[] arrar = {1,2,3};
for ( foo ) {
}
}
Which three are valid replacements for foo so that the program will compiled and run?
A.
int i: array
B.
int i = 0; i < 1; i++
C.
;;
D.
; i < 1; i++
E.
; i < 1;
I get B but a and c make no sence the array is named arrar so that wouldn’t work
i would go b d and not sure
A:It should be arrar.
C:infinite loop
D and E: both cases, variables i have not declared variable type
I suspect a typo in answer A
Should be:
int i: arrar
Then A B C are correct