public class X {
public static void main(String[] args) {
String[] table = { "aa", "bb", "cc" };
int ii = 0;
for (String ss : table)
{
while (ii <
table.length) {
System.out.println(ii);
ii++;
break;
}
}
}
}
How many times
is 2 printed?
A.
zero
zero
B.
once
once
C.
twice
twice
D.
thrice
thrice
E.
it is not printed because compilation fails
it is not printed because compilation fails
Risposta : B. viene stampato una volta.
Nessun commento:
Posta un commento