Choosing how to earn college credit? CLEP vs AP guide
| preferred AP College board partner for AP classes
medium Solved by 3 students

Object Reference Comparison

Mark
< 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

Rank
User
Correct Count
Attempt Count
Total Time
Score
#1y.seong202733 1m 03s 237
#2barkern19511 1m 01s 39
#3busemagngr13 1m 26s -6
Items per page:
10
1 – 3 of 3
No comments yet. Be the first to comment!

AI Tutor

How can I help?

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