Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
AP Computer Science A/Unit 7: ArrayList
Start Practice TestPractice Test
About Exam
medium Solved by 1 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

[quick, lazy, yellow, fox]

C

[yellow, lazy, fox]

D

[quick, yellow, lazy, fox]

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

Question Leaderboard

Not enough data yet to show leaderboard.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

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