Which three are valid replacements for foo so that the program will compiled and run?

<code>
public class ForTest {
public static void main(String[] args) {
int[] arrar = {1,2,3};
for ( foo ) {
}
}
</code>
Which three are valid replacements for foo so that the program will compiled and run?


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;



Leave a Reply 4

Your email address will not be published. Required fields are marked *


sully

sully

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

noname

noname

A:It should be arrar.
C:infinite loop

Joseph Vykukal

Joseph Vykukal

D and E: both cases, variables i have not declared variable type

Oene Bakker

Oene Bakker

I suspect a typo in answer A

Should be:
int i: arrar

Then A B C are correct