| preferred AP College board partner for AP classes
AP Computer Science A/Unit 7: ArrayList
Start Practice TestPractice Test
About Exam
medium Solved by 2 students
ArrayList Add and Set Methods
< Prev
Next >

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]

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Not enough data yet to show leaderboard.

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy