Unit 4 Cycle 2 Day 4: Array vs ArrayList
Share
Unit 4, Data Collections • Cycle 2
Day 4 Advanced Practice • Harder Difficulty
Focus: Array vs ArrayList
Hard
Array vs ArrayList
Advanced Practice Question
Format: Array vs ArrayList
Which statement is TRUE?
Which statement is TRUE?
int[] arr = {1, 2, 3};
ArrayList list = new ArrayList<>();
list.add(1);
list.add(2);
list.add(3);
Difficulty: Hard |
Topic: Array vs ArrayList |
Cycle: 2 (Advanced)
Why This Answer?
Arrays use .length (field, no parentheses). ArrayList uses .size() (method, with parentheses). So list.size() returns 3 is the only correct statement.
Common Mistake
Watch Out!
Confusing array.length (field) with ArrayList.size() (method).
AP Exam Strategy
Array = .length (no parens). ArrayList = .size() (with parens).
Master This Topic
This Cycle 2 HARD question tests array vs arraylist. Review Unit 4 concepts to build mastery of data collections.
- Understanding array vs arraylist
- Tracing code execution accurately
- Avoiding common pitfalls
Ready for More Challenges?
Cycle 2 questions prepare you for the hardest AP CSA exam questions.
Study Games Practice FRQs