AP CSA Topics | AP Computer Science A Complete Topic List
AP Computer Science A Topics (2026) — Practice by Unit and Skill
Every AP CSA topic organized by the 2025–2026 four-unit curriculum: Using Objects and Methods, Selection and Iteration, Arrays, and Data Collections. Each topic page has code examples, hard practice questions, common mistake callouts, and exam tips. Built by Tanner Crow, AP CS teacher with 11+ years of experience and a 54.5% student rate of scoring 5s on the AP CSA exam.
Quick Navigation
Unit 1 — Using Objects and Methods
String Methods
substring(), indexOf(), length(), compareTo(), equals() — with the exclusive-index trap
compareTo vs equals
When equals() returns boolean vs compareTo() returns int; the == reference trap
Object References and Aliasing
Heap storage, aliasing two variables to the same object, null reference crashes
Writing Classes
Private fields, constructors, methods, encapsulation — what AP graders expect
Constructors
No return type, parameter initialization, the void constructor mistake that costs FRQ points
Accessor and Mutator Methods
Getter/setter patterns, validation in mutators, aliasing risk with reference return types
Static vs Instance
One copy per class vs one per object; why static methods can't touch instance variables
Method Signatures and Return Types
void vs typed return, String immutability, discarding return values
Unit 2 — Selection and Iteration
Boolean Expressions and Logical Operators
&&, ||, !, operator precedence, De Morgan's Laws, I/II/III equivalence questions
Short-Circuit Evaluation
&& stops at first false; || stops at first true — null safety and divide-by-zero prevention
if/else Chains vs Independent ifs
Mutual exclusion, when independent ifs fire multiple branches unexpectedly
for Loop Tracing and Off-by-One Errors
Loop anatomy, < vs <=, step-by-step trace, counting iterations exactly
while Loops and Sentinel Loops
When to use while vs for, sentinel value pattern, infinite loop causes
Nested Loops
Total iterations = outer × inner (NOT outer + inner); grid and triangle patterns
String Traversal Patterns
substring(i, i+1) to get one character — charAt() is NOT on the Quick Reference
Common Loop Bugs
Infinite loops, skipping last element, double-increment, wrong update expression
break and continue
break exits innermost loop only; continue skips to next iteration — nested loop traps
Accumulators, Counters, Max and Min
Running sum, find max initialized to arr[0] not 0, linear search returning index or -1
Validating Input and Guard Conditions
Null checks, bounds checks, defensive programming — what FRQ graders deduct for
Runtime Errors: NullPointerException and ArrayIndexOutOfBoundsException
What triggers each, how to prevent, reading a stack trace concept
Unit 3 — Arrays
Array Initialization and Default Values
int[] default is 0; object[] default is null; arr.length has no parentheses
Array Traversal: Standard vs Enhanced for Loop
Standard for allows modification; enhanced for-each is read-only — assigning to loop variable does nothing
Finding Max, Min, and Counting in Arrays
Initialize max to arr[0] not 0 — breaks for all-negative arrays otherwise
Adjacent Element Patterns: i and i+1
Loop must stop at length-2 when accessing i+1; sorted-order checking pattern
Shifting Elements in Arrays
Shift right to insert (work backward); shift left to delete (work forward) — direction matters
Parallel Arrays
Keeping two arrays in sync; the bug when you sort one without the other
ArrayIndexOutOfBoundsException
Four ways to cause it; last valid index is arr.length-1 — high-search standalone page
Arrays of Objects
new Dog[5] gives 5 null references, NOT 5 Dog objects — must construct each element
Unit 4 — Data Collections
ArrayList Basics
add(), get(), set(), remove(), size() — size() not length; wrapper types required
ArrayList Traversal
Standard for with size(), enhanced for-each (read only), backward traversal for safe removal
Removing from ArrayList While Iterating
Forward remove skips elements; backward iteration or index-decrement fix
Sorting an ArrayList
Collections.sort(), Comparable interface concept, sorting objects by field
ArrayList of Objects
get() returns reference — calling mutator on returned reference DOES modify the list object
2D Arrays: Basics and Row-Major Traversal
grid[row][col]; grid.length = rows; grid[0].length = cols; nested loop traversal
2D Array Column-Major and Diagonal Patterns
Column-major traversal, main diagonal (row==col), anti-diagonal, row/column sums
2D Array Neighbor Checks and Bounds
Safe up/down/left/right neighbor access with full bounds check before every access
Searching and Sorting
Linear search O(n), binary search O(log n) on sorted only, selection sort, insertion sort
Pass-by-Value in Java
Primitives unchanged after method call; object fields CAN change; reassigning parameter has no effect
Standard Algorithms and Patterns
These patterns appear across multiple units and recur heavily in both MCQ and FRQ. Master the pattern, not just the syntax.
Accumulators, Counters, Max/Min
Running sum and count; initialize max to first element, not zero
Linear Search in Arrays
Scan and return index; return -1 if not found; use boolean flag for found/not-found
Adjacent Element Comparison
i and i+1 loop pattern; loop to length-2; sorted-order detection
Selection Sort and Insertion Sort
Selection: find min, swap; insertion: shift and place; binary search requires sorted input
FRQ Skills and Scoring Patterns
AP CSA has 4 FRQs worth 45% of the exam score. Each FRQ tests specific coding skills. Practice the released FRQs below — solutions include scoring rubric breakdowns and common point-loss patterns.
Common Mistakes That Cost Points
Every topic page has a dedicated Common Mistake box. The full aggregated list — 20+ specific errors organized by unit, each with a code example — is on the dedicated mistakes page. Teachers bookmark and share it.
→ See All AP CSA Common Mistakes (2026)
Quick Reference — String and ArrayList Methods
These are the only String and ArrayList methods provided on the AP CSA Java Quick Reference sheet. If a method is NOT in this table, you cannot assume it exists on the exam.
| Method | Return Type | What It Does |
|---|---|---|
int length() |
int | Number of characters in the String |
String substring(int from, int to) |
String | Characters from index from up to (NOT including) to |
String substring(int from) |
String | Characters from index from to the end |
int indexOf(String s) |
int | Index of first occurrence; -1 if not found |
boolean equals(String other) |
boolean | True if same character sequence (use instead of ==) |
int compareTo(String other) |
int | Negative if before, 0 if equal, positive if after (lexicographic) |
| ArrayList Method | Return Type | What It Does |
|---|---|---|
int size() |
int | Number of elements (NOT .length — that is an array field) |
boolean add(E obj) |
boolean | Appends obj to end; always returns true |
void add(int index, E obj) |
void | Inserts obj at index; shifts elements right |
E get(int index) |
E | Returns element at index (does NOT remove it) |
E set(int index, E obj) |
E | Replaces element at index with obj; returns old element |
E remove(int index) |
E | Removes and returns element at index; shifts elements left |
Bonus: Error-Specific Reference Pages
These pages target the exact error messages students search for. Each has 4–6 code examples showing every way to cause and fix the error.
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.
Message Sent!
Thanks for reaching out. I'll get back to you within 24 hours.
tanner@apcsexamprep.com
Courses
AP CSA, CSP, & Cybersecurity
Response Time
Within 24 hours
Prefer email? Reach me directly at tanner@apcsexamprep.com
- Choosing a selection results in a full page refresh.
- Opens in a new window.
Join 134+ AP CSA students getting better scores with daily practice
34.8% of Tanner’s CSP students score 5s. The national average is 9.6%.
AP Cyber launches nationally fall 2026. Help shape the course — free access for early members while we build it together.
Early members get free access and direct input on what gets created.
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.
Message Sent!
Thanks for reaching out. I'll get back to you within 24 hours.
tanner@apcsexamprep.com
Courses
AP CSA, CSP, & Cybersecurity
Response Time
Within 24 hours
Prefer email? Reach me directly at tanner@apcsexamprep.com