Enhanced For Loop With Primitives
What is the output of the code above?
public class ModifyEnhanced {
public static void main(String[] args) {
int[] data = {10, 20, 30};
for (int num : data) {
num += 5;
}
System.out.println(data[0]);
}
}
A
10
B
5
C
15
D
20
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | bommasam000 | 2 | 4 | 1m 08s | 112 |
| #2 | khanhnguyen.thor | 1 | 1 | 1m 34s | 6 |
| #3 | ntgamja1 | 0 | 1 | 0m 52s | -62 |
Items per page:
10
1 – 3 of 3
APFIVE