Q. What is the output of the Java program with Enhanced FOR loop below?
Code:
String countries[] = {"BRAZIL", "CHILE", "SYDNEY"};
int i=0;
for(String str: countries)
{
if(i<2)
;
else
break;
System.out.print(str + ",");
i++;
}
β
Correct Answer: (B)
BRAZIL,CHILE,