---
title: "Free AP Computer Science A Practice Questions, Study Guides & Mock Exams | FiveStudy"
description: "Free AP Computer Science A practice questions, unit-by-unit study guides, FRQ examples, and timed mock exams. AI-powered Smart Review adapts to your weak spots. Start for free."
url: https://fivestudy.com/ap-computer-science-a
---

# AP Computer Science A — Free Practice Questions, Study Guides & Mock Exams

Learn Java programming fundamentals, object-oriented programming, data structures, and algorithms

## Topics covered

- Variables and Data Types
- Operators and Expressions
- Conditional Statements
- Loops
- Arrays
- ArrayList
- 2D Arrays
- Methods
- Objects and Classes
- Inheritance
- Polymorphism
- Recursion
- Sorting and Searching
- Algorithm Analysis

## Free AP Computer Science A study guides

- [Represent Patterns and Algorithms](https://fivestudy.com/guides/represent-patterns-algorithms) — Input, steps, output — and the four workhorse patterns behind every program.
- [Compilation and Execution](https://fivestudy.com/guides/compilation-and-execution) — The two gates between typing a program and running it, and why a compiler that checks for only some errors makes a clean compile a much weaker claim than it sounds. AP CS A learning objective 1.1.B.
- [Programming Error Types](https://fivestudy.com/guides/programming-error-types) — Compile-time, runtime, logic: three error types that ambush three different stages.
- [Data Type Categories](https://fivestudy.com/guides/data-type-categories) — Primitive or reference — does the variable hold the value, or directions to it? Four step-by-step memory diagrams show the difference the moment you reassign. AP CS A learning objective 1.2.A.
- [Primitive Variable Declarations](https://fivestudy.com/guides/primitive-variable-declarations) — Type, name, value: the declaration promise, the four working types, and snapshot copies.
- [Output Statements](https://fivestudy.com/guides/output-statements) — print vs println and the traveling cursor, plus left-to-right concatenation rules.
- [String Literals and Escape Sequences](https://fivestudy.com/guides/string-literals-escape-sequences) — Two written characters, one stored: \n, \", and length that counts escapes as one.
- [Arithmetic Expressions](https://fivestudy.com/guides/arithmetic-expressions) — Precedence, integer division, and mod — the three facts behind every arithmetic trace.
- [Assignment Statements](https://fivestudy.com/guides/assignment-statements) — Right first, then store: the command meaning of =, self-referencing updates, and swaps.
- [Input](https://fivestudy.com/guides/input) — The Scanner pipeline: input is a queue, each call consumes the next piece, in order.
- [Primitive Casting](https://fivestudy.com/guides/primitive-casting) — Widening is free, narrowing costs the fraction — and cast placement decides the answer.
- [Integer Range and Overflow](https://fivestudy.com/guides/integer-range-overflow) — The int odometer wraps: past 2.1 billion, values flip sign with no warning.
- [Round-Off Error](https://fivestudy.com/guides/round-off-error) — Doubles approximate: why 0.1 + 0.2 isn't 0.3, and the tolerance idiom that replaces ==.
- [Compound Assignment Operators](https://fivestudy.com/guides/compound-assignment-operators) — += and friends: shorthand with a memory — the operator's rules survive the compression.
- [APIs and Libraries](https://fivestudy.com/guides/apis-and-libraries) — Packages, libraries, and API specifications — and how to identify a class's attributes and behaviors from documentation alone, without ever seeing its source. AP CS A learning objective 1.7.A.
- [Documentation with Comments](https://fivestudy.com/guides/documentation-with-comments) — The three Java comment forms, and the two promises a method makes — precondition and postcondition — that decide who is at fault when it misbehaves. AP CS A learning objective 1.8.A.
- [Method Identity and Signatures](https://fivestudy.com/guides/method-identity-signatures) — Name plus parameter list is identity; return type and parameter names are cosmetic.
- [Method Calls, Return Values, Arguments, and Overloading](https://fivestudy.com/guides/method-calls-returns-overloading) — Values in, value out: positional binding, substitution thinking, and overload selection.
- [Calling Class Methods](https://fivestudy.com/guides/calling-class-methods) — Static methods are reached through the class — no object, no construction, just the name path.
- [Math Class](https://fivestudy.com/guides/math-class) — Exactly five tools — abs, pow, sqrt, random — and the range-scaling pattern.
- [Objects: Instances of Classes](https://fivestudy.com/guides/objects-instances-of-classes) — What separates a class from an object, what a class hierarchy actually claims, and exactly where the exclusion statement stops the course.
- [Reference Type Variables](https://fivestudy.com/guides/reference-type-variables) — Primitives store values, objects store addresses — and copies behave differently.
- [Constructor Signatures](https://fivestudy.com/guides/constructor-signatures) — No return type, ever: the checklist that separates constructors from name-wearing methods.
- [Reference Variables for Objects](https://fivestudy.com/guides/reference-variables-for-objects) — Many names, one object: aliasing, counting news, and null as a name for nothing.
- [Object Instantiation](https://fivestudy.com/guides/object-instantiation) — new does three things in one expression — and every new is a distinct birth.
- [Calling Instance Methods](https://fivestudy.com/guides/calling-instance-methods) — object.method(args): the receiver supplies context, and chains run left to right.
- [String Objects, Immutability, and Concatenation](https://fivestudy.com/guides/string-immutability-concatenation) — Strings never change — operations give birth. What looks like change is rebirth.
- [String Methods](https://fivestudy.com/guides/string-methods) — Five methods on one index ruler: length, substring, indexOf, equals, compareTo.
- [Selection and Repetition](https://fivestudy.com/guides/selection-and-repetition) — Sequencing, selection and repetition — the three blocks every algorithm is built from, and why moving a decision inside or outside a loop gives you a different routine. AP CS A learning objective 2.1.A.
- [Relational Boolean Expressions](https://fivestudy.com/guides/relational-boolean-expressions) — Six comparison operators on the number line, the = vs == trap, and why integer division poisons comparisons.
- [One-Way and Two-Way Selection](https://fivestudy.com/guides/one-way-two-way-selection) — if filters, if-else forks: exactly one branch runs, the else is the precise negation, and braces always.
- [Nested and Multiway Selection](https://fivestudy.com/guides/nested-multiway-selection) — The else-if ladder: first true test wins and stops. Strict-to-loose ordering, or the lower rungs die.
- [Compound Boolean Expressions](https://fivestudy.com/guides/compound-boolean-expressions) — && demands both, || accepts either — and both short-circuit. The guard pattern puts the safe test left.
- [Equivalent Boolean Expressions](https://fivestudy.com/guides/equivalent-boolean-expressions) — De Morgan's rules: negate, swap, distribute — and comparisons flip their boundary when negated.
- [Object Reference Comparisons](https://fivestudy.com/guides/object-reference-comparisons) — == asks which box, equals asks what's inside. Aliasing, exact-case matching, and the null guard first.
- [Iteration Need and Loop Errors](https://fivestudy.com/guides/iteration-need-loop-errors) — Every loop is initialize, test, update — and fails in one of three ways: infinite, zero passes, off-by-one.
- [while Loop Processes](https://fivestudy.com/guides/while-loop-processes) — Prime, test, work, advance: sentinel runs and goal-driven processes where the pass count is unknown.
- [for Loop Processes](https://fivestudy.com/guides/for-loop-processes) — Three semicolon slots: init once, test before every pass, update after every body. Traces read themselves.
- [Numeric Selection and Iteration Algorithms](https://fivestudy.com/guides/numeric-selection-iteration-algorithms) — The digit machine (% reads, / deletes), divisor finding, and running extremes — selection inside iteration.
- [String Selection and Iteration Algorithms](https://fivestudy.com/guides/string-selection-iteration-algorithms) — substring windows sweep by index: count, search, and build new strings — immutability forces walk-and-build.
- [Nested Iteration Processes](https://fivestudy.com/guides/nested-iteration-processes) — Loops inside loops multiply. The full grid visits every pair; j = i + 1 keeps each unordered pair once.
- [Informal Run-Time Analysis](https://fivestudy.com/guides/informal-run-time-analysis) — Growth class, not clock time: one loop is linear, loop-in-loop quadratic, halving logarithmic. Doubling tells.
- [Class Design with Abstraction](https://fivestudy.com/guides/class-design-with-abstraction) — Deciding what a class knows and what it can do, on paper. Data abstraction, attributes, procedural abstraction and method decomposition. AP CS A learning objective 3.1.A.
- [Impact of Program Design](https://fivestudy.com/guides/impact-of-program-design) — System reliability, the social and economic impact of shipping software, and who owns the code you reused. AP CS A learning objective 3.2.A.
- [Access, Visibility, and Encapsulation](https://fivestudy.com/guides/access-visibility-encapsulation) — The visibility matrix, encapsulation's payoff, accessors/mutators as checkpoints, and a free-response style task.
- [Constructor State Initialization](https://fivestudy.com/guides/constructor-state-initialization) — Constructor anatomy, defaults, overloading, initialization order, and the return-type trap.
- [Writing Methods with Primitive Values](https://fivestudy.com/guides/writing-methods-primitive-values) — Seven recipes: direct boolean returns, double casts, every-path returns, and the copy-in/copy-out rule.
- [Passing and Returning Object References](https://fivestudy.com/guides/passing-returning-object-references) — References as remote controls: mutation vs reassignment, returning fields, and identity vs equality.
- [Class Methods](https://fivestudy.com/guides/class-methods) — What a static method can reach, what it cannot, and the one way to hand it an object anyway — plus why main is static and what that forces on you. AP CS A learning objective 3.7.A.
- [Class Variables and Constants](https://fivestudy.com/guides/class-variables-and-constants) — static = one shared slot, static final constants, and the access boundary between static and instance.
- [Scope and Shadowing](https://fivestudy.com/guides/scope-and-shadowing) — Where a variable is visible, why parameters are local variables, and the shadowing rule behind the constructor that compiles, runs, and quietly does nothing. AP CS A learning objective 3.8.A.
- [The this Keyword](https://fivestudy.com/guides/this-keyword) — Shadowing, the this.x = x idiom, the reversed accident, and scope-ring lookup order.
- [Privacy Risks in Data Collection](https://fivestudy.com/guides/privacy-risks-in-data-collection) — Why collecting and storing are two different risks, why minimisation is the one safeguard that survives a compromise, and why the class you write for question 3 is already a record about people.
- [Data Quality and Bias](https://fivestudy.com/guides/data-quality-and-bias) — Algorithmic bias, the collection method that decides who gets counted, and why incomplete or inaccurate data makes correct code produce wrong answers. AP CS A learning objective 4.1.B.
- [Appropriate Data Sets](https://fivestudy.com/guides/appropriate-data-sets) — Why a data set can be complete, accurate and fairly collected and still be the wrong one for the question being asked of it — proxy measures, original purpose, granularity, and the three-step check.
- [Using Data Sets](https://fivestudy.com/guides/using-data-sets) — Draw the table first. Why every data-set algorithm visits values one at a time, what each one carries forward, and how a chart is used to plan the algorithm. AP CS A learning objective 4.2.A.
- [Array Creation and Access](https://fivestudy.com/guides/array-creation-and-access) — Why the length can never change, why nothing in an array is ever empty, and why the last index is always one less than the count.
- [Array Traversals](https://fivestudy.com/guides/array-traversals) — The hidden assignment inside every enhanced for loop &mdash; why it can never write into an array, and why it can still change every object an array points at.
- [Array Algorithms](https://fivestudy.com/guides/array-algorithms) — Sum, max, count, and search on arrays — the four workhorse loops plus the shift patterns.
- [File I/O](https://fivestudy.com/guides/file-io)
- [Wrapper Classes](https://fivestudy.com/guides/wrapper-classes) — Why an Integer object can never be edited once it exists, the exact four situations in which the compiler boxes or unboxes for you, and why parsing text is a different operation entirely.
- [ArrayList Methods](https://fivestudy.com/guides/arraylist-methods) — All six exam methods on one table, the add/remove index shift traced step by step, and the four traps that cost the most points.
- [ArrayList Traversals](https://fivestudy.com/guides/arraylist-traversals) — Indexed vs enhanced walks, what each can do, and the skip bug when removal meets the enhanced cursor.
- [ArrayList Algorithms](https://fivestudy.com/guides/arraylist-algorithms) — The accumulator family on ArrayLists: sum, max, count, transform with set, and backward pruning.
- [2D Array Creation and Access](https://fivestudy.com/guides/2d-array-creation-and-access) — Row-first addressing, the two lengths, rectangularity, and reading cells by formula.
- [2D Array Traversals](https://fivestudy.com/guides/2d-array-traversals) — Nested loops: the outer index picks row-major or column-major, and the output fingerprints which.
- [2D Array Algorithms](https://fivestudy.com/guides/2d-array-algorithms) — Grid versions of the workhorses, row/column slices as single loops, and in-place transforms.
- [Linear Search Algorithms](https://fivestudy.com/guides/linear-search-algorithms) — Walk until found or finished: the sentinel -1, best and worst cases, and cost growth with size.
- [Iterative Sorting Algorithms](https://fivestudy.com/guides/iterative-sorting-algorithms) — Selection and insertion traced pass by pass: invariants, swap counts, and when each wins.
- [Recursive Method Calls](https://fivestudy.com/guides/recursive-method-calls) — Base case plus recursive case, traced as stack frames: descent, then values climbing back up.
- [Recursive String and Collection Traversal](https://fivestudy.com/guides/recursive-string-collection-traversal) — Head plus rest over strings and lists: substring(1), index-passing, and the recursion tree as trace.
- [Binary Search](https://fivestudy.com/guides/binary-search) — The halving window: low, high, mid, the <= bound, and why sortedness is the entry fee.
- [Merge Sort](https://fivestudy.com/guides/merge-sort) — One array traced the whole way down and the whole way back, because the objective asks for the result of each iteration — including the merge order students most often get wrong.

## Units

- [Unit 1: practice questions](https://fivestudy.com/ap-computer-science-a/unit-1)
- [Unit 2: practice questions](https://fivestudy.com/ap-computer-science-a/unit-2)
- [Unit 3: practice questions](https://fivestudy.com/ap-computer-science-a/unit-3)
- [Unit 4: practice questions](https://fivestudy.com/ap-computer-science-a/unit-4)

[Browse all subjects](https://fivestudy.com/subjects) · [All study guides](https://fivestudy.com/guides)
