Object-oriented programming and problem-solving in Java.
Study guide last reviewed September 25, 2026 · see what changed
Format reflects the current published structure — always confirm against AP Central before test day, since formats occasionally change.
| Section | Details | Time | Weight |
|---|---|---|---|
| Section I – Multiple Choice | 40 questions | 1 hr 30 min | 50% |
| Section II – Free Response | 4 questions (methods/control structures, classes, arrays/ArrayLists, 2-D array) | 1 hr 30 min | 50% |
Straight answers about the AP Computer Science A exam — format, credit, dates, and this site.
Section I – Multiple Choice: 40 questions (1 hr 30 min, 50% of the total score); Section II – Free Response: 4 questions (methods/control structures, classes, arrays/ArrayLists, 2-D array) (1 hr 30 min, 50% of the total score). See the Exam Format tab above for the full breakdown, and always double-check the current year's format on AP Central before test day.
It's multiple-choice questions and written free-response or essay questions.
It depends entirely on the college — most award credit for a 3 or higher, but many selective schools require a 4 or a 5, and some don't grant credit at all for certain scores. Always check your target college's own AP credit policy page rather than assuming a 3 will count everywhere.
AP exams are administered during the College Board's annual testing window in the first two full weeks of May, with the exact date and time for each subject set by the College Board and announced the preceding fall. Check AP Central or your school's AP coordinator for this year's exact date.
Yes. The unit-by-unit study guide, worked examples, practice quiz, and full-length timed practice exam on this page are all free, with no login, signup, or paywall.
Unit-by-unit breakdown of what the course actually covers, in teaching order.
Java's primitive data types (int, double, boolean, char), variable declaration and initialization, arithmetic operators including integer division and the modulus operator, operator precedence, and type casting between int and double, including the precision loss that occurs when casting double to int.
Instantiating objects with the 'new' keyword and constructors, calling instance methods and understanding the distinction between void and value-returning methods, object references versus primitive values (and how this affects parameter passing and aliasing), and using built-in classes like String and Math.
Relational operators (==, !=, <, >, etc.) and logical operators (&&, ||, !) including short-circuit evaluation, if/else if/else chains and nested conditionals, and De Morgan's laws for simplifying compound boolean expressions — a frequent source of logic-error questions.
For loops (initialization, condition, update) versus while loops, and when each is more natural to use, nested loops for processing 2-D structures, and common iteration patterns like accumulator variables, counting matches, and finding min/max values while traversing a collection.
Defining classes with instance variables, constructors (including overloaded constructors), accessor (getter) and mutator (setter) methods, encapsulation via private instance variables with public methods controlling access, and the 'this' keyword for disambiguating instance variables from parameters.
Declaring, initializing, and traversing 1-D arrays with both indexed for-loops and enhanced for-loops, common array algorithms (finding max/min, computing a sum/average, searching for a value, reversing), and the distinction between array length (a field, no parentheses) versus String length() (a method).
The ArrayList<E> generic class and its key methods (add, remove, get, set, size), traversing an ArrayList with both standard and enhanced for-loops (and the ConcurrentModificationException risk when removing elements during an enhanced for-loop), and converting between arrays and ArrayLists.
Declaring and initializing 2-D arrays (arrays of arrays), traversing with nested loops (row-major vs. column-major order), and common 2-D array algorithms like summing rows/columns, finding a value, and processing grid-like data — a frequent, heavily-weighted FRQ topic.
The 'extends' keyword for creating subclasses, method overriding (same signature, different implementation) versus overloading (different signature), the 'super' keyword for calling a superclass's constructor or methods, and polymorphism — how a superclass reference can point to a subclass object and calls the overridden method at runtime.
Writing recursive methods with a base case (stopping condition) and a recursive case that moves toward it, tracing recursive calls using a call stack/trace diagram, and classic recursive algorithms including factorial, Fibonacci, and recursive array/2-D array traversal — a topic many students find conceptually difficult and worth extra practice.
Concrete, fully worked examples — this is what separates a page reviewers see as genuinely useful from one that just lists topics.
What does this print? int a = 7; int b = 2; double result = a / b; System.out.println(result);
Output: 3.0, not 3.5. a / b is integer division (7/2 = 3, remainder discarded) that happens before the result is ever assigned to a double. The fix is casting an operand first: (double) a / b.
What does this print? String s = "Hello"; String t = new String("Hello"); System.out.println(s == t);
Output: false, even though s.equals(t) would be true. == compares object references (memory addresses), not content — two separately constructed String objects have different references even with identical characters.
Simplify using De Morgan's law: !(x > 5 && y < 10).
Equivalent to (x <= 5 || y >= 10) — negating an AND flips it to an OR, and each individual comparison also flips (negating > gives <=, negating < gives >=).
Trace this nested loop: for (int i=1; i<=3; i++) { for (int j=1; j<=i; j++) System.out.print("*"); System.out.println(); }
Output is a right triangle: *, then **, then *** on three lines. The outer loop controls the row; the inner loop's upper bound depends on the outer variable — this pattern (an inner bound tied to the outer counter) is a recurring FRQ structure.
Find the maximum in int[] arr = {3, 7, 2, 9, 4};
Initialize max = arr[0] (= 3), then loop from index 1, updating max whenever a larger value appears. Final answer: 9. The classic trap is initializing max = 0 instead — that silently fails whenever every array value is negative.
Why does this throw an exception? Removing elements from an ArrayList inside an enhanced for-loop.
It throws ConcurrentModificationException — modifying a collection's size while an enhanced for-loop iterates over it is never safe. The fix: iterate backwards with an indexed for-loop, or use an Iterator's own remove() method.
Sum each row of a 2-D array and store the results in a 1-D array.
Use a nested loop: the outer loop walks rows, the inner loop walks columns accumulating a running sum that resets to 0 at the start of each new row — forgetting that reset (carrying a total across rows) is the single most common bug in this pattern.
What gets called? Animal a = new Dog(); a.makeSound();, where Dog overrides makeSound().
Dog's version runs — polymorphism means the method called depends on the object's actual runtime type (Dog), not the reference's declared type (Animal). This dynamic dispatch is the mechanism behind most FRQ inheritance questions.
Trace factorial(4) given factorial(n) { return n <= 1 ? 1 : n * factorial(n-1); }
Calls unwind down to factorial(1) = 1, then multiply back up: 2×1, 3×2, 4×6 = 24. Every recursive method needs a base case that stops the recursion and a recursive case that provably moves toward it — missing either causes infinite recursion and a StackOverflowError.
== (reference equality for objects) and .equals() (content equality) cold — it's one of the most frequently tested conceptual traps on the exam.The errors that cost the most points across the whole exam, not just one unit.
== (reference equality) with .equals() (content equality) for objects, leading to unexpected false results comparing Strings.<= versus <) that skip the last array element or throw an ArrayIndexOutOfBoundsException.Unofficial practice questions written for this study guide — not official AP content and not from College Board. Use them to self-check, then use the real past free-response questions below for authentic exam practice.
Unofficial practice exercises. Write your solution, then reveal a sample solution and self-grade against the rubric — there's no compiler here to run your code automatically.
Unofficial practice, timed to feel like the real thing. Section I pulls from this page's full multiple-choice bank; Section II gives you free-response prompts to write out and self-score against a rubric. Bank size is still growing toward full exam length — timing is paced per-question, not pulled from this subject's official duration.