| preferred AP College board partner for AP classes
AP Computer Science A/Unit 4: Iteration
Start Practice TestPractice Test
About Exam
medium Solved by 3 students
Object Reference Comparison
< Prev
Next >

Consider the following code segment. Which of the Boolean expressions will evaluate to true after the segment has been executed?

ArrayList<String> list1 = new ArrayList<String>();
ArrayList<String> list2 = new ArrayList<String>();
ArrayList<String> list3 = list1;

list1.add("apple");
list2.add(new String("apple"));
A

(list2 == list3)

B

(list1 == list3)

C

(list1 == list2)

D

(list1.get(0) == list2.get(0))

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.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

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