Practice · 1 of 4
Exam MCQ
CHALLENGE
Difficulty: advanced+25 XP
What is printed?
``java
int[] a = {4, 1, 4, 2};
int best = a[0];
for (int v : a) {
if (v > best) { best = v; }
}
int second = Integer.MIN_VALUE;
for (int v : a) {
if (v < best && v > second) { second = v; }
}
System.out.print(second);
``
A. 1
B. 2
C. 4
D. -2147483648
Print the letter, then your one-sentence justification.
Press Submit to check your solution.
Back to lesson: Practice: Exam #1: MCQ section