Practice · 6 of 8
MCQ: What is the result of `check(new int[]{5, 20}, 5)`?
CHALLENGE
Difficulty: advanced+25 XP
What is the result of check(new int[]{5, 20}, 5)?
``java
public static boolean check(int[] arr, int idx) {
return idx < arr.length && arr[idx] > 10;
}
``
A. true
B. ArrayIndexOutOfBoundsException
C. false
D. compile error
Print your answer as: the option letter, then your explanation of why it is correct and why each other option is wrong. First line must start with the letter.
Press Submit to check your solution.
Back to lesson: Practice: MCQ set 1: read the misconception