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?

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 2

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


Hans

Hans

A, when arrar is a typo
B, alright
C, posssible but not logical
D, i is unknown, when i was declared it would be valid
E, i is unknown, when i was declared it would be valid

DK

DK

Option A you should change array to arrar