---
title: "Object — AP Computer Science A Definition & Exam Guide"
description: "An object is an instance of a class with its own data (instance variables) and behavior (methods). Objects power every AP CSA FRQ, from constructors to polymorphism."
canonical: "https://fiveable.me/ap-comp-sci-a/key-terms/object"
type: "key-term"
subject: "AP Computer Science A"
---

# Object — AP Computer Science A Definition & Exam Guide

## Definition

In AP Computer Science A, an object is an instance of a class, created with the new keyword, that bundles its own data (instance variables) with behavior (methods). The class is the blueprint; the object is the actual thing built from it that lives in memory while your program runs.

## What It Is

An object is a specific [instance](/ap-comp-sci-a/unit-1/objects-instances-of-classes/study-guide/EcpFHGcIKu6385hMohLe "fv-autolink") of a class. The class is the blueprint, and the object is the actual house built from it. Each object gets its own copy of the class's [instance variables](/ap-comp-sci-a/key-terms/instance-variables "fv-autolink"), so two `Dog` objects can have different names and ages even though they came from the same class. Objects also carry behavior, meaning you can call methods on them (like `myDog.bark()`) and the method runs using that particular object's data.

In Java, you create an object by calling a [constructor](/ap-comp-sci-a/unit-1/creating-and-storing-objects/study-guide/rUOTKl6Ih5noXJ0GtxJF "fv-autolink") with the `new` keyword, like `Dog d = new Dog("Rex", 3);`. One subtle but huge detail for the AP exam is that the variable `d` doesn't hold the object itself. It holds a *reference* to the object, basically the object's address in memory. That's why two variables can point to the same object, and why changing the object through one variable shows up when you look at it through the other.

## Why It Matters

Objects are the spine of the entire AP CSA course, which is why the exam is built around object-oriented programming. You first learn to *use* objects (calling [constructors](/ap-comp-sci-a/unit-3/constructors/study-guide/3Ez6zzak2wRwMrTj2ZQk "fv-autolink") and methods on classes someone else wrote), then to *write* your own classes that produce objects with instance variables, constructors, and methods. Later, inheritance and polymorphism are entirely about the relationship between an object's actual type and the type of the [reference variable](/ap-comp-sci-a/key-terms/reference-variable "fv-autolink") pointing at it. If you don't have a solid mental model of what an object is, almost every FRQ becomes harder than it needs to be, because every FRQ either uses objects or asks you to design a class that creates them.

## Connections

### Class (Units 2 & 5)

A [class](/ap-comp-sci-a/unit-3/abstraction-and-program-design/study-guide/o9VgVeIpKRYZ7N7rXfUz "fv-autolink") and an object are two halves of the same idea. The class is the cookie cutter; objects are the cookies. You can stamp out as many objects as you want from one class, and each one keeps its own data.

### Constructor & New Keyword (Unit 2)

Objects don't just appear. The [new keyword](/ap-comp-sci-a/key-terms/new-keyword "fv-autolink") calls a constructor, the constructor initializes the instance variables, and out comes a fresh object. If a class has overloaded constructors, you pick which one to call by the arguments you pass.

### Instance Variable (Unit 5)

Instance variables are the per-object data. Every object created from a class gets its own copies, which is exactly why `dog1.name` and `dog2.name` can be different. When you write a class on the FRQ, choosing the right instance variables is choosing what each object remembers.

### Inheritance & Polymorphism (Unit 9)

Here the exam splits hairs between an object's actual type and its [reference type](/ap-comp-sci-a/key-terms/reference-type "fv-autolink"). A `Poodle` object can sit behind an `Animal` reference because a Poodle is-a Animal, but casting that reference back down only works if the object really is a Poodle. Get this wrong and you get a ClassCastException at runtime.

## On the AP Exam

Objects show up everywhere, so the exam tests whether you understand them at three levels. MCQs love reference behavior, like which declarations are legal in an inheritance hierarchy (can an `Animal` variable hold a `Poodle` object?) and which casts cause a ClassCastException at runtime. They also test polymorphism, where the object's actual type decides which overridden method runs, as in a `Shape` reference pointing to a `Circle` object. On the FRQ side, you're constantly creating and using objects. The 2017 exam alone had Q1 (Digits) asking you to build an object that stores a number's digits in an ArrayList, Q2 asking you to design a full class implementing the StudyPractice interface, and Q3 (Phrase) asking you to write methods that operate on an object's instance variable. Expect to write constructors that initialize instance variables, call methods on objects, and reason about what happens when multiple references point to the same object.

## Object vs Class

A class is the blueprint; an object is the thing built from it. The class exists once in your code and defines what instance variables and methods every object will have. Objects exist at runtime, possibly in the thousands, each with its own data. You write `public class Dog {...}` exactly once, but `new Dog(...)` can run as many times as you want, and each call makes a separate object.

## Key Takeaways

- An object is an instance of a class, created at runtime with the new keyword, and each object gets its own copies of the instance variables.
- Variables in Java hold references to objects, not the objects themselves, so two variables can point to the same object and see each other's changes.
- Calling a constructor with new is the only way to create an object, and the constructor's job is to initialize that object's instance variables.
- With inheritance, a superclass reference can point to a subclass object (an Animal variable can hold a Dog object), but never the reverse.
- When a method is overridden, the object's actual type, not the reference type, decides which version of the method runs at runtime.
- Every AP CSA FRQ involves objects in some way, whether you're writing a class that creates them or writing methods that use them.

## FAQs

### What is an object in AP Computer Science A?

An object is an instance of a class that bundles data (instance variables) and behavior (methods) together. You create one with the new keyword, like `Dog d = new Dog("Rex", 3);`, and each object keeps its own copies of the instance variables.

### Is an object the same thing as a class?

No. The class is the blueprint written once in your code, and objects are the actual things built from it at runtime. One class can produce unlimited objects, each with different data.

### What's the difference between an object and a reference variable?

The object is the actual data living in memory, while the variable holds a reference (the object's address). That's why `Dog a = b;` doesn't copy the dog, it just makes two variables point to the same object, and a change through one shows up in the other.

### Can a superclass variable hold a subclass object?

Yes. `Animal a = new Poodle();` is legal because a Poodle is-a Animal, and this is the basis of polymorphism. The reverse, like `Poodle p = new Animal();`, won't compile, and a bad downcast like casting a plain Student object to GradStudent throws a ClassCastException at runtime.

### How do objects show up on the AP CSA free-response questions?

Every FRQ involves objects. FRQ 2 is always class design, where you write a full class with instance variables, a constructor, and methods (like the 2017 StudyPractice question), and the other FRQs have you write methods that use or modify an object's data, like 2017's Digits and Phrase questions.

## Structured Data

```json
{"@context":"https://schema.org","@graph":[{"@type":"LearningResource","@id":"https://fiveable.me/ap-comp-sci-a/key-terms/object#resource","name":"Object — AP Computer Science A Definition & Exam Guide","url":"https://fiveable.me/ap-comp-sci-a/key-terms/object","learningResourceType":"Concept explainer","educationalLevel":"AP® / High School","about":{"@id":"https://fiveable.me/ap-comp-sci-a/key-terms/object#term"},"audience":{"@type":"EducationalAudience","educationalRole":"student"},"dateModified":"2026-06-12T22:37:11.902Z","isPartOf":{"@type":"Collection","name":"AP Computer Science A Key Terms","url":"https://fiveable.me/ap-comp-sci-a/key-terms"},"publisher":{"@type":"Organization","name":"Fiveable","url":"https://fiveable.me"}},{"@type":"DefinedTerm","@id":"https://fiveable.me/ap-comp-sci-a/key-terms/object#term","name":"Object","description":"In AP Computer Science A, an object is an instance of a class, created with the new keyword, that bundles its own data (instance variables) with behavior (methods). The class is the blueprint; the object is the actual thing built from it that lives in memory while your program runs.","url":"https://fiveable.me/ap-comp-sci-a/key-terms/object","inDefinedTermSet":{"@type":"DefinedTermSet","name":"AP Computer Science A Key Terms","url":"https://fiveable.me/ap-comp-sci-a/key-terms"}},{"@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What is an object in AP Computer Science A?","acceptedAnswer":{"@type":"Answer","text":"An object is an instance of a class that bundles data (instance variables) and behavior (methods) together. You create one with the new keyword, like `Dog d = new Dog(\"Rex\", 3);`, and each object keeps its own copies of the instance variables."}},{"@type":"Question","name":"Is an object the same thing as a class?","acceptedAnswer":{"@type":"Answer","text":"No. The class is the blueprint written once in your code, and objects are the actual things built from it at runtime. One class can produce unlimited objects, each with different data."}},{"@type":"Question","name":"What's the difference between an object and a reference variable?","acceptedAnswer":{"@type":"Answer","text":"The object is the actual data living in memory, while the variable holds a reference (the object's address). That's why `Dog a = b;` doesn't copy the dog, it just makes two variables point to the same object, and a change through one shows up in the other."}},{"@type":"Question","name":"Can a superclass variable hold a subclass object?","acceptedAnswer":{"@type":"Answer","text":"Yes. `Animal a = new Poodle();` is legal because a Poodle is-a Animal, and this is the basis of polymorphism. The reverse, like `Poodle p = new Animal();`, won't compile, and a bad downcast like casting a plain Student object to GradStudent throws a ClassCastException at runtime."}},{"@type":"Question","name":"How do objects show up on the AP CSA free-response questions?","acceptedAnswer":{"@type":"Answer","text":"Every FRQ involves objects. FRQ 2 is always class design, where you write a full class with instance variables, a constructor, and methods (like the 2017 StudyPractice question), and the other FRQs have you write methods that use or modify an object's data, like 2017's Digits and Phrase questions."}}]},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"AP Computer Science A","item":"https://fiveable.me/ap-comp-sci-a"},{"@type":"ListItem","position":2,"name":"Key Terms","item":"https://fiveable.me/ap-comp-sci-a/key-terms"},{"@type":"ListItem","position":3,"name":"Object"}]}]}
```
