AP Computer Science A Quiz
20 questions · no time limit
0:00
DATA COLLECTIONS
Question 1 of 20
No time limit
Current
Answered
Flagged
Not seen
A library stores a small catalog of book IDs by index. Given the code snippet,
public class Library {
public static void main(String[] args) {
// Each index is a shelf position; values are book IDs
int[] bookIds = {101, 205, 309, 412};
// Retrieve the third element (index 2)
int id = bookIds[2];
System.out.println(id);
}
}Which line of code correctly accesses the third element of the array? YOUR PROGRESS
20
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