Array and ArrayList Methods Quick Reference (AP CSA 2026)

Bookmark This Page

Array & ArrayList Methods Quick Reference (2026)

Every method, property, and syntax pattern you need — organized exactly how the exam tests them.

AP CSA Exam: May 15, 2026. The Quick Reference is only available during FRQs. Memorize this for MCQs.

1D Array Reference

Operation Syntax Notes
Declare + create int[] arr = new int[5]; Fixed size, defaults to 0
Declare + initialize int[] arr = {1, 2, 3}; Size = number of values
Access element arr[i] 0-indexed
Set element arr[i] = value; Direct assignment
Length arr.length Field (no parentheses)
Last element arr[arr.length - 1] Common exam question
Standard for loop for (int i = 0; i < arr.length; i++) Use when modifying or need index
Enhanced for loop for (int val : arr) Read-only, no index access
Default: int[] 0 Primitives default to zero-value
Default: String[] null Objects default to null

ArrayList Reference

Method Syntax Notes
Create ArrayList list = new ArrayList(); Must use wrapper class for primitives
Size list.size() Method with parentheses
Add to end list.add(element) Returns true, grows list by 1
Add at index list.add(index, element) Shifts elements right
Get element list.get(index) Returns element at index
Set element list.set(index, element) Replaces in place, returns old value
Remove by index list.remove(index) Shifts elements left, returns removed
Standard for for (int i = 0; i < list.size(); i++) Use when modifying or removing
Enhanced for for (Type val : list) Cannot add/remove during iteration

Critical Differences (Exam Traps)

Feature Array ArrayList
Size syntax .length .size()
Access syntax arr[i] list.get(i)
Can resize? No Yes
Primitives? Yes No (use Integer, Double)
Modify in for-each? No effect ConcurrentModificationException

2D Array Reference

Operation Syntax Notes
Declare + create int[][] grid = new int[rows][cols]; rows × cols grid
Number of rows grid.length Outer array length
Number of columns grid[0].length Inner array length
Access element grid[row][col] Row first, column second
Row-major traversal for r < grid.length, for c < grid[0].length Outer=rows, inner=cols
Column-major traversal for c < grid[0].length, for r < grid.length Outer=cols, inner=rows

Get the Complete Quick Reference PDF

All 4 units on one printable 12-page reference guide.

Quick Reference Guide Book Tutoring

Get in Touch

Whether you're a student, parent, or teacher — I'd love to hear from you.

Just want free AP CS resources?

Enter your email below and check the subscribe box — no message needed. Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.

Typically responds within 24 hours

Message Sent!

Thanks for reaching out. I'll get back to you within 24 hours.

🏫 Welcome, fellow educator!

I offer curriculum resources, practice materials, and study guides designed for AP CS teachers. Let me know what you're looking for — whether it's classroom materials, a guest speaker, or Teachers Pay Teachers resources.

Email

[email protected]

📚

Courses

AP CSA, CSP, & Cybersecurity

Response Time

Within 24 hours

Prefer email? Reach me directly at [email protected]