int[] a = {10, 20, 30};
for (int x : a) {
System.out.print(x + " ");
}What is printed?
- Acheck_circle
10 20 30
- B
10 20 30
- C
30 20 10
- D
0 1 2
Explanation
The for-each loop prints each element followed by a space, in order. Note: a trailing space is included after 30.