PrepGo

AP Computer Science A Unit 1: Using Objects and Methods

Written by AP Content Team, Verified for 2026 AP Exams, Last updated: April 13, 2026

Unit Big Picture

This unit lays the foundation for all programming in Java. We begin by understanding how a computer executes instructions, then learn to store and manipulate fundamental data using variables and expressions. The unit culminates in learning how to leverage pre-written code by creating and using objects, which are the building blocks of all complex Java applications. By the end of this unit, you will be able to write simple programs that perform calculations and manipulate text data.

Core Threads

Thread 1: Data & Representation

  • This unit introduces the core ways Java represents information, starting with primitive types (e.g., int, double) that hold single, raw values.

  • We then progress to using Objects (like String), which are complex data types that bundle together data and the behaviors (methods) that act on that data.

Thread 2: Abstraction & APIs

  • We learn to use powerful, pre-built tools from Java's libraries (like the Math class) without needing to know their internal implementation details.

  • This introduces the concept of an Application Program Interface (API), which defines how we interact with a class by calling its methods.

Key Java Concepts & Data Structures

Java Concept / Data StructureWhat It Is (1-Sentence)Why It Matters (1-Sentence)
Primitive Data TypesThe most basic data types (int, double, boolean) that store single, simple values.They are the fundamental building blocks for storing all numerical and logical data in a program.
VariableA named location in memory that stores a value of a specific data type.Variables allow us to label, store, and manipulate data throughout our program.
ExpressionA combination of values, variables, and operators that evaluates to a single new value.Expressions are how we perform calculations and make logical decisions in code.
ClassA blueprint or template that defines the properties and behaviors for a type of object.Classes allow us to model real-world concepts and create our own custom data types.
ObjectA specific instance of a class, with its own state and access to the class's behaviors.Objects are the primary actors in Java programs, bundling data and functionality together.
Method CallAn instruction that executes a named block of code, often on a specific object.Method calls allow us to reuse code and interact with objects to perform actions.

Unit Concept & Syntax Bank

  • int, double, boolean: The three core primitive types for storing integers, floating-point numbers, and true/false values, respectively.

  • = (Assignment Operator): Stores the value of the expression on the right into the variable on the left (e.g., int x = 10;).

  • +, -, *, /, %: Arithmetic operators used to perform addition, subtraction, multiplication, division, and find the remainder (modulo).

  • System.out.println(): A method call that prints a value to the console, followed by a new line.

  • new (keyword): The operator used to create, or instantiate, a new object from a class blueprint.

    
    String greeting = new String("Hello");
    
  • . (Dot Operator): The syntax used to access a method belonging to an object or a class (e.g., greeting.length() or Math.sqrt(9)).

  • Method Signature: The combination of a method's name and its parameter list, which uniquely identifies it (e.g., println(String s)).

  • Casting: The explicit conversion of a value from one data type to another, such as (int) 3.14, which results in the value 3.

  • String: A class representing a sequence of characters; String objects are immutable, meaning their contents cannot be changed after creation.

Topic Navigator

Topic TitleWhat This Adds (<=10 words)
1.1: Intro to Algorithms, Programming, CompilersUnderstanding what a program is and how it runs.
1.2: Variables and Data TypesStoring information using named primitives like int and double.
1.3: Expressions and OutputPerforming calculations and displaying results to the user.
1.4: Assignment Statements and InputChanging variable values and getting user input.
1.5: Casting and Range of VariablesConverting between data types and understanding their limits.
1.6: Compound Assignment OperatorsUsing shortcuts for common arithmetic assignments (e.g., +=).
1.7: API and LibrariesDiscovering pre-written code available for us to use.
1.8: Documentation with CommentsWriting human-readable notes inside our code.
1.9: Method SignaturesUnderstanding how to identify and use methods correctly.
1.10: Calling Class MethodsUsing methods that belong to a class itself (static).
1.11: Math ClassUsing static methods for common mathematical functions.
1.12: Objects: Instances of ClassesDefining what an object is: a bundle of data/behavior.
1.13: Object Creation and StorageCreating new objects in memory using the new keyword.
1.14: Calling Instance MethodsUsing methods that belong to a specific object instance.
1.15: String ManipulationUsing the methods of the String class to process text.

Exam Skills Focus

  • Code Implementation: Writing statements that declare variables, perform calculations, and call methods on objects.

  • Code Analysis: Tracing the execution of a program to determine the final value of variables and the output produced.

  • Application & Design: Selecting the appropriate data types and Math or String methods to solve a given problem.

Common Misconceptions & Clarifications

  • Integer Division: When dividing two integers, the result is also an integer; any fractional part is truncated. For example, 7 / 2 evaluates to 3, not 3.5.

  • Assignment vs. Equality: The single equals sign (=) is the assignment operator; it stores a value in a variable. It does not check if two values are equal.

  • Objects vs. Primitives: A primitive (int, double) holds a simple value directly. An object (String) is a more complex entity that holds a reference (memory address) to its data and has methods you can call using the dot operator.

Summary

This unit transitions you from a computer user to a programmer. You begin by learning the fundamental grammar of Java: how to declare variables to store data, use operators to form expressions, and call methods to perform actions. The focus then shifts from creating simple instructions to using powerful, pre-built tools. By creating and manipulating objects from classes like String and Math, you learn the core object-oriented paradigm of bundling data and behavior, setting the stage for building more complex applications.