Array Element Assignment
What value is printed when the code is executed?
public class Main {
public static void main(String[] args) {
int[] points = {5, 10, 15, 20};
points[1] = points[2] - 5;
points[3] = points[0] + points[1];
System.out.println(points[3]);
}
}
A
15
B
25
C
30
D
20
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | bommasam000 | 4 | 4 | 2m 59s | 221 |
| #2 | y.seong2027 | 1 | 1 | 0m 26s | 74 |
| #3 | suhanakochhar006 | 1 | 1 | 0m 27s | 73 |
| #4 | singhris000 | 1 | 1 | 1m 32s | 8 |
| #5 | sathilak000 | 1 | 1 | 1m 56s | -16 |
| #6 | geethasailaja | 1 | 5 | 1m 55s | -55 |
APFIVE