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
In this game inventory, what is the value of item after set and get?
import java.util.ArrayList;
public class GameDemo {
public static void main(String[] args) {
ArrayList<String> inventory = new ArrayList<String>();
inventory.add("Potion");
inventory.add("Sword");
inventory.add("Shield");
inventory.set(0, "Elixir");
String item = inventory.get(0);
System.out.println(item);
}
} 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