APhigh school
AP Computer Science A
Learn object-oriented programming in Java from the ground up, aligned to the College Board AP Computer Science A curriculum. You will write classes, manipulate arrays and ArrayLists, use inheritance and polymorphism, and solve problems with recursion -- building the coding confidence you need for a 4 or 5 on exam day.
10units
10topics
175questions
~4hours
Course Units
Learning objectives
- Declare and initialize variables using int, double, and boolean types
- Evaluate arithmetic expressions including integer division and modulus behavior
- Apply widening and narrowing type casts and predict their output
- Trace compound assignment operators (+=, -=, *=, /=, ++) through multi-step expressions
- Identify how overflow and precision loss affect int and double values
Topics in this unit
Learning objectives
- Create objects using constructors and the new keyword, distinguishing from primitive declarations
- Call String methods (length, substring, indexOf, equals, compareTo) and predict their return values
- Use Math class static methods (abs, pow, sqrt, random) in expressions
- Distinguish reference equality (==) from content equality (.equals()) for objects
- Explain what null means and identify when a NullPointerException will be thrown
Topics in this unit
Learning objectives
- Evaluate boolean expressions using relational (<, >, <=, >=, ==, !=) and logical (&&, ||, !) operators
- Trace execution paths through if, if-else, and else-if chains with multiple branches
- Apply De Morgan's Laws to simplify negated compound boolean expressions
- Identify dangling-else behavior in nested conditionals and predict which branch executes
- Recognize short-circuit evaluation of && and || and its effect on side effects
Topics in this unit
Learning objectives
- Write and trace for, while, and do-while loops, predicting the number of iterations
- Apply the accumulator, counter, and sentinel patterns to solve loop-based problems
- Trace nested loop execution and calculate total iteration counts
- Identify and fix off-by-one errors caused by boundary conditions (< vs <=, starting at 0 vs 1)
- Convert between equivalent for and while loop structures
Topics in this unit
Learning objectives
- Design classes with private instance variables and public methods following encapsulation principles
- Write constructors including overloaded constructors and constructor chaining with this()
- Implement accessor (getter) and mutator (setter) methods with appropriate access modifiers
- Distinguish static members from instance members and explain when to use each
- Use the this keyword to resolve ambiguity between parameters and instance variables
Topics in this unit
Learning objectives
- Declare, create, and initialize one-dimensional arrays with both literal and new syntax
- Traverse arrays using standard for loops and enhanced for-each loops
- Implement common array algorithms: sum, average, min/max, linear search, and selection sort
- Identify and prevent ArrayIndexOutOfBoundsException caused by incorrect loop bounds
- Pass arrays to methods and explain that arrays are passed by reference in Java
Topics in this unit
Learning objectives
- Create and manipulate ArrayLists using add, remove, get, set, and size methods
- Apply autoboxing and unboxing with ArrayList<Integer> and other wrapper types
- Avoid the index-shifting bug when removing elements during forward traversal
- Compare arrays and ArrayLists and choose the appropriate data structure for a given problem
- Use ArrayList as a parameter and return type in method signatures
Topics in this unit
Learning objectives
- Declare and initialize 2D arrays using both literal and nested new syntax
- Traverse 2D arrays in row-major and column-major order using nested for loops
- Access individual elements using [row][col] indexing and explain why order matters
- Implement 2D array algorithms: row/column sums, search, transpose, and boundary checks
- Handle ragged (jagged) arrays where rows have different lengths
Topics in this unit
Learning objectives
- Create subclasses using extends and call superclass constructors with super()
- Override methods and distinguish method overriding from method overloading
- Apply polymorphism: assign subclass objects to superclass reference variables and predict dynamic dispatch
- Use abstract classes and methods to define contracts that subclasses must fulfill
- Explain the Object class as the root of Java's class hierarchy (toString, equals)
Topics in this unit
Learning objectives
- Identify base cases and recursive cases, and explain why both are necessary
- Trace recursive method execution using a call stack diagram
- Write recursive solutions for factorial, Fibonacci, binary search, and String processing problems
- Compare recursive and iterative approaches in terms of clarity, correctness, and efficiency
- Identify when recursion leads to stack overflow and how to prevent it
Topics in this unit