Skip to main content
The new Teacher Workspace is here. Your first 3 assignments are free. Try it →
A colleague sent you $30 off Fiveable. Get the annual plan for $99 →

Object in AP Computer Science A

In AP Computer Science A, an object is a specific instance of a class. It has its own values for the attributes the class defines and can use the behaviors (methods) the class provides. It is usually created with the keyword new and a constructor call, and it is accessed through a reference variable.

Verified for the 2027 AP Computer Science A exam•Last updated October 2026

What is Object?

An object is one specific thing built from a class. The CED puts it this way (EK 1.12.A.1). A class is the formal implementation, or blueprint, of attributes and behaviors. An object is a specific instance of that class with defined attributes. If Student is the blueprint, then the student named "Ana" in grade 11 is one object, and "Ben" in grade 9 is another. They share the same blueprint but hold different data.

You usually make an object with the keyword new followed by a constructor call, like new Student("Ana", 11) (EK 1.13.C.1). You don't store the object itself in a variable. A reference-type variable holds an object reference, which you can think of as the object's memory address (EK 1.12.B.1). If no object exists yet, that variable holds null (EK 1.13.B.1). So a variable is basically a sticky note with the object's address written on it, not the object itself.

Why Object matters in AP® Computer Science A

Objects are the core idea of Unit 1: Using Objects and Methods. They show up across three topics. Topic 1.7 is about using existing classes from libraries and APIs to create objects. Topic 1.12 covers the class/object relationship and reference variables. Topic 1.13 is about actually building objects with constructors. The learning objectives you need are 1.12.A (explain the relationship between a class and an object), 1.12.B and 1.13.B (declare variables that hold object references), 1.13.A (identify which constructor is called from its signature), 1.13.C (create an object by calling a constructor), and 1.7.A (identify a library class's attributes and behaviors). Pretty much every AP CSA free-response question assumes you can create objects, store references to them, and call methods on them. That makes this the vocabulary the whole rest of the course is written in.

How Object connects across the course

Class (Unit 1)

A class is the cookie cutter and objects are the cookies. The class says what every object will have and do. Each object fills in its own values. One class can produce as many objects as you want, and changing one object's data doesn't change the others.

Constructor and Object Construction (Unit 1)

Constructors are how objects get born. A constructor has the same name as the class, and its parameters set the object's starting attribute values. When a class has overloaded constructors, Java picks the one whose parameter types match your arguments in order and number. That's exactly the matching skill topic 1.13.A tests.

Reference Variables and null (Unit 1)

A variable like Student s doesn't contain a student. It contains directions to one. That explains why two variables can point to the same object, and why a variable set to null points to nothing at all. Once you picture references as addresses, a lot of tricky trace questions stop being tricky.

Libraries, APIs, and Inheritance (Unit 1)

You don't have to write every class yourself. Libraries are collections of ready-made classes, and API documentation tells you their attributes and behaviors so you can create objects from them (like String objects). The CED also introduces class hierarchies here. Subclasses extend a superclass and inherit its attributes and behaviors, so an object of a subclass gets that shared stuff for free.

Is Object on the AP® Computer Science A exam?

On multiple choice, object questions usually come in a few flavors. Pick the valid creation statement. Given a class like Student with a constructor Student(String n, int g), which line correctly creates an instance? Look for new, the class name, and arguments that match the parameter types in order and number. Trace object state. Questions built around classes like BankAccount or Counter make you track what each object holds after several constructor calls. These often mix in a static variable, which is shared by the whole class, alongside instance variables, which each object gets its own copy of. Design reasoning. Some questions ask whether to model something, like books in a library system, as separate objects or as one object whose state changes.

On free response, objects are everywhere even when the prompt doesn't say "object." The 2017 FRQs show this. Q1's Digits class stores a list of digits "from the number used to construct this object." Q3's Phrase class keeps its phrase in an instance variable that its methods access and change. Q2 has you design a class from scratch. Q4 contrasts this by asking for static methods, which don't need an object to be called. Across all of these, you have to write constructors that initialize instance variables, create objects with new, and call methods on the right object.

Object vs Class

A class is the definition, and an object is a thing made from that definition. The class Student is written once in code and describes what every student has (a name, a grade). An object like new Student("Ana", 11) is created while the program runs and holds actual values. Here's a quick test. If you can ask "what are its values right now?", you're talking about an object. If you're asking "what can things of this type do?", you're talking about the class.

Key things to remember about Object

  • An object is a specific instance of a class, and the class is the blueprint that defines the attributes and behaviors every object of that type will have.

  • Objects are typically created with the keyword new followed by a call to one of the class's constructors, such as new Student("Ana", 11).

  • A reference-type variable stores an object reference, which works like the object's memory address, not the object itself.

  • If a reference variable doesn't point to any object, its value is null.

  • Constructor arguments must match the constructor's parameter list in order, number, and type, and that match tells you which overloaded constructor gets called.

  • Each object has its own copy of instance variables, while a static variable is shared by every object of the class.

Frequently asked questions about Object

What is an object in AP Computer Science A?

An object is a specific instance of a class, with its own attribute values and access to the class's behaviors (methods). In AP CSA you usually create one with new plus a constructor call and store a reference to it in a variable.

What's the difference between a class and an object in Java?

A class is the blueprint that defines attributes and behaviors, and an object is one concrete thing built from that blueprint. You write the Student class once, but you can create many Student objects, each with a different name and grade.

Does a variable actually store the object in Java?

No. A reference-type variable stores an object reference, which you can think of as the object's memory address (EK 1.12.B.1). That's why two variables can refer to the same object, and why a variable can hold null when there's no object.

How do you create an object in AP CSA?

Use the keyword new followed by a constructor call, like Student s = new Student("Ana", 11);. The arguments have to match the constructor's parameter types in order and number, or the code won't compile.

Is a static variable part of each object?

No. A static variable belongs to the class and is shared by all objects, while instance variables are separate for each object. Practice questions with classes like BankAccount or Counter often use a static counter that goes up every time a constructor runs, so watch which variable each object really owns.