ArrayList Add and Set Methods
What is the output of the following code segment?
ArrayList<String> wordList = new ArrayList<String>();
wordList.add("quick");
wordList.add("brown");
wordList.add("fox");
wordList.add(2, "lazy");
wordList.set(1, "yellow");
System.out.print(wordList);
A
[quick, brown, lazy, fox]
B
[yellow, lazy, fox]
C
[quick, lazy, yellow, fox]
D
[quick, yellow, lazy, fox]
Question Leaderboard
Not enough data yet to show leaderboard.
APFIVE