This is essentially a full, unit-by-unit guide of all the topics covered on the AP Exam. More detailed explanations of each topic are offered in the unit pages (see table of contents).
Printing with System.out.print
and System.out.println
Literals, including string literals
Concept of a type
Primitive vs. reference types
Primitive types for AP CSA: int
, double
, boolean
char
is not assessed on the AP Exam
Limitations on int
Integer
, not the literal values)Concept of a variable
Declaring variables
The final
keyword
Arithmetic operations on int
and double
values
+
, -
, *
, /
, %
Operator precedence (i.e. order of operations)
ArithmeticException
upon dividing by zero
Integer math vs. double math and when each is used
Assignment operator: =
Compound assignment operators: +=
, -=
, *=
, /=
, %=
Increment and decrement operators: ++
, --
Casting with int
and double
Rounding with the casting operators
Purpose of the constructor: to set the initial state of an object
Constructor signatures: name and parameter list
Constructors have the same name as the class
Formal vs. actual parameters
"Call by value" as it applies to constructors
Overloaded constructors
new
keyword and calling a constructor
Concept of an object's methods (collectively, its behavior)
Method signatures: method name, parameter list, and return type
void
return type
Overloaded methods
Call methods with the dot operator (.
) and parameter(s), if applicable
Flow of control when calling a method
Use return values of methods
String
, Integer
, Double
, Math
Grouping of classes into packages
java.lang
packagejava.lang
does not need to be importedBasic concept of APIs and libraries: to simplify complex tasks
String
Create String
objects; two methods:
Immutability of String
objects
Concatenation of String
objects
String
is created because String
s are immutableString
implicitly converts the primitive to a String
String
implicitly calls the object's toString
method to convert it to a String
Escape sequences: \"
. \\
, \n
Valid String
indices
StringIndexOutOfBoundsException
String
methods on the Java Quick Reference
substring
method of a String
to retrieve the element at index i
, i.e. single element substringInteger
and Double
wrapper classesDistinction between the wrapper classes and the associated primitives
Integer
and Double
methods on the Java Quick Reference
Autoboxing and unboxing
Math
classCall static methods with the class name
Math
static methods on the Java Quick Reference
Math.random
Abstraction with methods
null
keyword
null
or a reference to an object
Dog one = null; // null value
Dog two = new Dog(); // reference to an object
NullPointerException
when trying to perform certain operations with a null
referenceif
StatementsRelational equality operators: ==
, !=
Relational comparison operators: <
, <=
, >
, >=
Write/evaluate Boolean expressions with these relational operators
Purpose behind conditional statements
Write/use if
statements (also known as a one-way selection)
Write/use if-else
statements (also known as a two-way selection)
Incorporate else if
statements into if
and if-else
statements (multi-way selection)
Difference between and when to use if
vs. if-else
statements, as well as when to incorporate else if
statements
Nested if
statements
Logical operators: !
, &&
, ||
Write/evaluate compound Boolean expressions with these logical operators
Short-circuited evaluation
De Morgan's logic laws
Truth tables
Understand the concept of equivalent Boolean expressions
Aliases (in the context of object references)
Use of the relational equality operators and null
to determine if a variable of a reference type points to an actual object
.equals
methods to check for equivalency
Equivalency vs. equality for objects
Understand the purpose behind iteration
Write/use while
loops
Write/use for
loops
Flow of control for these loops
while
loop: Repetition until the Boolean expression evaluates to false
for
loop: Initialization statement, then repetition until the Boolean expression evaluates to false
, with the increment statement after each iterationRewrite for
loops as while
loops and vice versa
Infinite loops
Loops that never execute
Return statements inside loops
Off by one errors
Write/use nested loops
Flow of control for these loops
Determine how many times a specific statement executes
Compare two loops
Access modifiers (public
and private
only)
public
private
public
public
or private
Data encapsulation
private
access modifier and accessor/mutator methods to achieve thisObject state and the "has-a" relationship
Write constructors to establish initial object state
Purpose and use of constructor parameters to set state
Not destroying/modifying objects provided as parameters to the constructor – store a copy of the object in an instance variable instead
Destroying persistent data on the AP Exam FRQs will result in a score penalty.
Default no-argument constructor
Describe code with comments and understand their purpose
The three types of Java comments (single-line, block, Javadoc)
Preconditions
There is no expectation that you check input against the preconditions when writing FRQs, and it will result in a score penalty if you write an incorrect check.
Postconditions
The concept of methods – input is usually passed in, something is done, and sometimes a value is returned
Write methods to perform tasks with input/return values
Void vs. non-void methods
Declaring return types
"Return by value"
private
access modifier rules apply to parameters
Not destroying/modifying objects provided as parameters to methods unless required
Destroying persistent data on the AP Exam FRQs will result in a score penalty.
Formal parameter initialization
The concept that static members are associated with a class, not an object
Write static methods and declare static variables
Call static methods and use static variables
static
keyword
No this
reference
Write/understand the purpose of accessor (getter) methods
Write/understand the purpose of mutator (setter) methods
this
Local scope
Local variables have precedence over instance variables when they have the same name
this
keyword
The toString
method, its purpose, and how to override it
Understand that the toString
method is implicitly called when an object is passed to one of the print methods
Method decomposition
The ethical and social implications of computing are not assessed on the AP Exam.
Concept and purpose of an array
Array creation syntax with new
Array access syntax with square brackets
Create and modify arrays
Array size is fixed
Default values for array elements
int
, double
, boolean
, and reference typesInitializer lists
Valid array indices
ArrayIndexOutOfBoundsException
Meaning of "traversing an array"
Use for
or while
loops to traverse arrays with indices
Use enhanced for
loops to traverse arrays with the enhanced for
loop variable
for
loop variable are copies of the array elementsfor
loop cannot be used to edit the array valuesAwareness of and avoidance of off by one errors
ArrayList
ArrayList
sDifferences between arrays and ArrayList
Properties of an ArrayList
ArrayList
creation syntax with constructor
Generic typing vs. non-generic typing
Importing ArrayList
from the java.util
package
ArrayList
sArrayList
methods in the Java Quick Reference
Utilize the ArrayList
methods to modify ArrayList
s
Traverse an ArrayList
with for
, while
, and enhanced for
loops
Valid indices for ArrayList
s
ArrayList
s are zero-indexedIndexOutOfBoundsException
ConcurrentModificationException
when modifying an ArrayList
while traversing it with an enhanced for
loop
ArrayList
algorithmsIdentify, modify, and develop the following algorithms:
ArrayList
ArrayList
Be able to traverse multiple objects simultaneously to execute these algorithms
These topics are applicable to both arrays and
ArrayList
s.
Understand and apply the following algorithms:
Compare these algorithms based on the number of times specified statements execute
The ethical issues regarding data collection are not assessed on the AP Exam.
"Array of arrays" concept
2D array creation syntax with new
2D array access syntax with sets of square brackets
Create and modify 2D arrays
Initializer lists for 2D arrays
Row-major vs. column-major order
The AP Exam uses row-major order.
Nested loops
Use nested for
and nested enhanced for
loops to traverse 2D arrays
Traversing the 2D array in row-major vs. column-major order
Identify, modify, and develop all array algorithms with 2D arrays
Sequential/linear search
Concept of a superclass and subclass
Concept of class hierarchy
"is-a" relationship between subclass and superclass
extends
keyword to define a subclass
Subclasses may only have one superclass
Call superclass constructors and methods with super
and parameters, if applicable
Implicit call to no-argument superclass constructor when there is no explicit call
Execution order of constructors in the class hierarchy
Object
), then constructor execution from top (Object
) to bottom (subclass)Method overriding in subclasses
Additional methods and instance variables in subclasses
The subclass inherits public methods but not constructors
Understand and apply polymorphism
Object
class (java.lang
package) as a superclass of all classes
Object
methods in the Java Quick ReferenceConcept of recursion and its applications
Components of a recursive method, i.e. base case and recursive method call
Unique local variables for each recursive method call, including parameters, which indicate the progress of the recursion
Recursion vs. iteration
Understand traversal of various objects and data structures with recursion
Determine the result of a recursive method
Writing recursive code is not assessed on the AP Exam.
Binary search
Merge sort