Array vs ArrayList: What the AP CSA Exam Actually Tests

Unit 4 — Know the Difference

Array vs ArrayList: What the AP CSA Exam Actually Tests

The exam targets the specific differences between these two. Know them cold.

AP CSA Exam: May 15, 2026. You will see both arrays and ArrayList on every section of the exam.

Side-by-Side Comparison

Feature Array ArrayList
Size Fixed at creation Grows and shrinks dynamically
Declaration int[] nums = new int[5]; ArrayList nums = new ArrayList();
Access element nums[i] nums.get(i)
Set element nums[i] = 10; nums.set(i, 10);
Length / Size nums.length (field) nums.size() (method)
Add element Not possible (fixed size) nums.add(10);
Remove element Not possible (fixed size) nums.remove(i);
Primitives Stores directly (int, double) Wrapper classes only (Integer, Double)
Default values 0 for int, null for objects Empty (size 0)
Enhanced for Works (read-only) Works (read-only, no modification)
FRQ focus FRQ 4 (2D arrays) FRQ 3 (always ArrayList)

Syntax Comparison: Same Task, Different Code

Traversal

ARRAY
int[] data = {10, 20, 30};
for (int i = 0; i < data.length; i++)
{
    System.out.println(data[i]);
}
ARRAYLIST
ArrayList data = new ArrayList();
data.add(10);
data.add(20);
data.add(30);
for (int i = 0; i < data.size(); i++)
{
    System.out.println(data.get(i));
}

Find Maximum

ARRAY
int max = vals[0];
for (int i = 1; i < vals.length; i++)
{
    if (vals[i] > max)
    {
        max = vals[i];
    }
}
ARRAYLIST
int max = vals.get(0);
for (int i = 1; i < vals.size(); i++)
{
    if (vals.get(i) > max)
    {
        max = vals.get(i);
    }
}
Pattern: The algorithm is identical. Only the syntax changes: [] becomes .get(), and .length becomes .size(). The exam tests whether you can translate between the two.

Exam Traps: What College Board Targets

Trap #1

.length vs .size() Mix-Up

Using .size() on an array or .length on an ArrayList causes a compile error. The exam loves this.

Trap #2

Bracket Notation on ArrayList

Writing list[i] instead of list.get(i) is a compile error. ArrayList is not an array — you must use methods.

Trap #3

Primitives in ArrayList

ArrayList does not compile. You must use ArrayList. Java autoboxes between int and Integer, but the declaration must use the wrapper class.

Trap #4

Cannot Resize an Array

Arrays have no add() or remove(). If the exam asks you to add an element to an array, you must create a new larger array and copy elements over. ArrayList handles this automatically.

Know Arrays and ArrayList Inside Out

Get a structured day-by-day study plan that covers both — with practice problems for each.

4-Week Cram Kit — $29.99 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]