Career upgrade: Learn practical AI skills for better jobs and higher pay.
Level up
All Practice Exams

100+ Free AP Computer Science A Practice Questions

Pass your AP Computer Science A exam on the first try — instant access, no signup required.

✓ No registration✓ No credit card✓ No hidden fees✓ Start practicing immediately
100+ Questions
100% Free
1 / 100
Question 1
Score: 0/0

A helper method used only inside a class to support its public methods should generally be declared with which access modifier?

A
B
C
D
to track
Same family resources

Explore More Advanced Placement (AP)

Continue into nearby exams from the same family. Each card keeps practice questions, study guides, flashcards, videos, and articles in one place.

2026 Statistics

Key Facts: AP Computer Science A Exam

42

multiple-choice questions in Section I (55% of the exam score)

College Board AP Central

4

free-response questions in Section II (45% of the exam score)

College Board AP Central

3 hours

total testing time, split evenly between the two sections

College Board AP Central

4 units

course structure effective Fall 2025 (down from 10 units)

AP CSA Course and Exam Description 2025

1-5

score scale; a 3 or higher typically earns college credit

College Board

Java

the single programming language used on the entire exam

College Board AP Central

The AP Computer Science A exam is a 3-hour Java programming test with 42 multiple-choice questions (Section I, 1 hour 30 minutes, 55% of the score) and 4 free-response questions (Section II, 1 hour 30 minutes, 45%). Effective Fall 2025 the course was redesigned into four units: Using Objects and Methods, Selection and Iteration, Class Creation, and Data Collections; inheritance and polymorphism were removed and reading text files with Scanner was added. There is no penalty for wrong multiple-choice answers, the exam is scored 1-5, and a 3 or higher typically earns college credit (source: College Board, AP Central).

Sample AP Computer Science A Practice Questions

Try these sample questions to test your AP Computer Science A exam readiness. Each question includes a detailed explanation. Start the interactive quiz above for the full 100+ question experience with AI tutoring.

1What is the value of the expression 17 / 5 in Java, where both operands are of type int?
A.3
B.3.4
C.4
D.3.0
Explanation: In Java, when both operands of the / operator are int, the result is integer division, which truncates toward zero and discards any fractional part. 17 / 5 is 3 because 5 goes into 17 three times with a remainder. The remainder (2) would be obtained with 17 % 5.
2Given String s = "Computer";, what does s.substring(2, 5) return?
A."mput"
B."mpu"
C."omp"
D."ompu"
Explanation: The substring(int from, int to) method returns characters from index from up to but NOT including index to. With "Computer", index 2 is 'm', index 3 is 'p', index 4 is 'u', and index 5 ('t') is excluded. The result is "mpu".
3What does the expression Math.abs(-7) + Math.pow(2, 3) evaluate to?
A.1.0
B.15
C.15.0
D.13.0
Explanation: Math.abs(-7) returns the int 7. Math.pow(2, 3) returns the double 8.0 because Math.pow always returns a double. Adding an int and a double promotes the result to a double, so 7 + 8.0 evaluates to 15.0.
4Consider: double d = (double) 9 / 4; What value is stored in d?
A.2.0
B.2.5
C.2
D.2.25
Explanation: The cast (double) has higher precedence than /, so 9 is first converted to 9.0, then divided by 4. Because one operand is now a double, floating-point division occurs: 9.0 / 4 equals 2.25.
5Given String word = "banana";, what does word.indexOf("an") return?
A.1
B.2
C.3
D.-1
Explanation: The indexOf method returns the index of the first occurrence of the given substring. In "banana", the substring "an" first appears starting at index 1 (b=0, a=1, n=2). indexOf returns the index of the first match only, so it returns 1.
6What is printed by the following code? String a = "cat"; String b = "car"; System.out.println(a.compareTo(b) > 0);
A.false
B.true
C.0
D.1
Explanation: compareTo compares strings lexicographically character by character. "cat" and "car" match at indices 0 and 1, then differ at index 2: 't' (116) versus 'r' (114). Since 't' is greater, compareTo returns a positive number, so the expression a.compareTo(b) > 0 is true.
7Which expression correctly tests whether two String references s1 and s2 contain the same sequence of characters?
A.s1 == s2
B.s1.compareTo(s2)
C.s1.equals(s2)
D.s1 = s2
Explanation: For Strings, the equals method compares the actual character content and returns true when the sequences match. The == operator compares object references (whether they point to the same object), which can be false even for equal content. So s1.equals(s2) is the correct content comparison.
8A method has the signature public void change(int x). Inside change, x is reassigned to x * 2. After calling change(n) where int n = 5, what is the value of n?
A.10
B.It depends on the method body
C.0
D.5
Explanation: Java passes primitives by value, meaning the method receives a copy of n's value. Reassigning the parameter x inside the method changes only the local copy, not the original variable n. Therefore n remains 5 after the call.
9Which of the following correctly declares an ArrayList that stores Integer values?
A.ArrayList<Integer> list = new ArrayList<Integer>();
B.ArrayList<int> list = new ArrayList<int>();
C.ArrayList list = new int[10];
D.Integer<ArrayList> list = new Integer<ArrayList>();
Explanation: ArrayList requires a class (reference) type as its type parameter, not a primitive. The wrapper class Integer must be used instead of the primitive int. ArrayList<Integer> list = new ArrayList<Integer>(); is the correct declaration; autoboxing then lets you add int literals.
10What does the following print? String s = "Hello"; System.out.println(s.length());
A.4
B.5
C.6
D."Hello"
Explanation: The length() method returns the number of characters in a String. "Hello" contains the characters H, e, l, l, o, which is 5 characters. Note that String uses length() with parentheses, unlike arrays which use .length with no parentheses.

About the AP Computer Science A Exam

AP Computer Science A is an introductory college-level computer science course taught in Java. Effective Fall 2025, the course is organized into four units: Using Objects and Methods, Selection and Iteration, Class Creation, and Data Collections. The exam is delivered digitally in the Bluebook app and has a 42-question multiple-choice Section I (55% of the score) and a 4-question free-response Section II (45%), for about 3 hours of testing.

Questions

42 scored questions

Time Limit

3 hours (1h30m multiple-choice + 1h30m free-response)

Passing Score

Scored 1-5; a 3 or higher typically earns college credit

Exam Fee

About $99 (College Board)

AP Computer Science A Exam Content Outline

15-25%

Unit 1: Using Objects and Methods

Object references and aliasing, calling methods, String and Math methods, casting and integer division, wrapper classes, and pass-by-value.

25-35%

Unit 2: Selection and Iteration

Boolean logic, short-circuit evaluation, if/else, while and for loops, nested loops, String traversal, and accumulator/counter patterns.

10-18%

Unit 3: Class Creation

Writing classes, constructors, instance variables, accessor and mutator methods, static vs instance members, this, and encapsulation.

30-40%

Unit 4: Data Collections

Arrays, ArrayList, 2D arrays, traversal patterns, linear and binary search, selection/insertion/merge sort, recursion tracing, and File/Scanner input.

How to Pass the AP Computer Science A Exam

What You Need to Know

  • Passing score: Scored 1-5; a 3 or higher typically earns college credit
  • Exam length: 42 questions
  • Time limit: 3 hours (1h30m multiple-choice + 1h30m free-response)
  • Exam fee: About $99

Keys to Passing

  • Complete 500+ practice questions
  • Score 80%+ consistently before scheduling
  • Focus on highest-weighted sections
  • Use our AI tutor for tough concepts

AP Computer Science A Study Tips from Top Performers

1Practice tracing code by hand on paper, writing down the value of each variable after every loop iteration before you pick an answer.
2Memorize the AP Java Quick Reference methods: String (substring, indexOf, length, compareTo, equals), Math, and ArrayList (add, get, set, remove, size).
3Watch for integer division: in Java, 7 / 2 is 3, not 3.5, unless one operand is a double.
4Know the difference between array .length, String .length(), and ArrayList .size() — mixing these up is a classic exam trap.
5When removing elements while iterating an ArrayList, iterate backward or adjust the index, because forward removal skips elements.

Frequently Asked Questions

How many questions are on the AP Computer Science A exam?

Section I has 42 multiple-choice questions (1 hour 30 minutes, 55% of the score) and Section II has 4 free-response questions (1 hour 30 minutes, 45%), for about 3 hours of testing total.

What programming language is used on the AP CSA exam?

AP Computer Science A is taught and tested entirely in Java. The exam provides a Java Quick Reference listing the specific String, Math, and ArrayList methods you are expected to know.

What changed in the 2025-2026 AP CSA course?

Effective Fall 2025 the ten older units were consolidated into four: Using Objects and Methods, Selection and Iteration, Class Creation, and Data Collections. Inheritance and polymorphism were removed, and reading text files with the File and Scanner classes was added.

How is the AP Computer Science A exam scored?

The exam is scored on the standard AP 1-5 scale. There is no penalty for wrong multiple-choice answers, so you should answer every question. A score of 3 or higher typically earns college credit.

Is recursion still on the AP CSA exam?

Yes. Recursion appears in Unit 4 (Data Collections) and is primarily tested as recursion tracing, where you predict the output or return value of given recursive code rather than writing it.

How much does the AP Computer Science A exam cost?

The standard US AP exam fee for 2025-26 is about $99 per exam. Fee reductions are available for eligible students through the College Board.