Unit 4 · Data Collections
ArrayList Insert and Remove
ArrayList Insert and Remove MCQ Practice
Question 1 of 15
Answered 0 of 15
Choose one answer.
What is printed by the following code segment?
public class ArrayListInsertAndRemoveContext
{
public static void runExample()
{
ArrayList<Integer> a = new ArrayList<Integer>();
a.add(1);
a.add(2);
a.add(3);
a.remove(1);
System.out.print(a);
}
public static void main(String[] args)
{
runExample();
}
}