AP Computer Science A Quiz
10 questions · no time limit
0:00
DATA COLLECTIONS
Question 1 of 10
No time limit
Current
Answered
Flagged
Not seen
What will be the output of the given code snippet?
// Part A: Setup
ArrayList<Integer> numbers = new ArrayList<>();
numbers.add(4);
numbers.add(9);
numbers.add(1);
// Part B: Find maximum
int maxValue = Integer.MIN_VALUE;
for (int value : numbers) { // traverse list
if (value > maxValue) {
maxValue = value;
}
}
// Part C: Output
System.out.println(maxValue); YOUR PROGRESS
10
QUESTIONS
Ready when you are
Answer in any order. Your progress shows here as you go.
QUESTIONS
KEYBOARD
Pick an answer ABCD
Next question ↵→
Previous ←
Flag for review F
Answers save as you go · flagged questions come back at the end