Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
AP Computer Science A/Unit 2: Using Objects
Start Practice TestPractice Test
About Exam
medium Solved by 6 students

Object Reference Variable Aliasing

< Prev
Next >

Develop code to declare variables to store reference types.

Consider this code segment that declares and initializes reference variables:

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

list1.add("Java");
list2.add("Python");
list3.add("C++");

After this code executes, what is the size of the ArrayList referenced by list1?

A

3

B

0

C

1

D

2

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Total Time
Score
#1ntgamja122 1m 50s 90
#2kaisuki12 0m 00s 90
#3bommasam00013 1m 15s 5
#4richa.tuli01 0m 13s -23
#5zgj0731041712 2m 03s -33
#6jaimonjosh01 1m 40s -110
#7chunxiangxu.cxu01 2m 56s -186
#8lsj0803092212 16m 26s -896
Items per page:
10
1 – 8 of 8
No comments yet. Be the first to comment!

AI Tutor

How can I help?

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