engineering recuitment IB JIO (Junior Intelligence Officer) Mock Test 2023 Programming and Data Structure Java
What correction is required for following Java code snippet to compile?
int [ ] X = new int [10];
for (int P = 0; P <= X.length (); P++)
X [P] = 5;
1
P <= X.length() should be P < X.length
2
P++ should be P + 1
3
X.length() should be X.length
4
X[P] = 5 should be X(P) = 5