---
title: "Instance Method — AP CSA Definition & Exam Guide"
description: "An instance method is called on an object using the dot operator and can use that object's instance variables. Know it for Topics 1.14 and 3.7 on AP CSA."
canonical: "https://fiveable.me/ap-comp-sci-a/key-terms/instance-method"
type: "key-term"
subject: "AP Computer Science A"
unit: "Unit 3"
---

# Instance Method — AP CSA Definition & Exam Guide

## Definition

In AP Computer Science A, an instance method is a method that belongs to an object of a class and is called on that object with the dot operator (like word.length()), giving it access to that specific object's instance variables (EK 1.14.A.1).

## What It Is

An instance method is a behavior that belongs to a specific [object](/ap-comp-sci-a/key-terms/object "fv-autolink"), not to the [class](/ap-comp-sci-a/unit-3/abstraction-and-program-design/study-guide/o9VgVeIpKRYZ7N7rXfUz "fv-autolink") as a whole. You call it by writing the object's name, a dot, then the method name, like `numbers.add(10)` or `c.increment()`. The dot operator is literally how you tell Java "run this method *on this particular object*" (EK 1.14.A.1).

The big idea is that an instance method can read and change that object's [instance variables](/ap-comp-sci-a/key-terms/instance-variables "fv-autolink"). If you have two `Counter` objects and call `increment()` on one of them, only that one's `count` goes up. The other object is untouched. One critical rule from the CED: if the object reference is `null`, there's no object to act on, so calling any instance method on it throws a `NullPointerException` (EK 1.14.A.2). That single fact powers a huge number of MCQ traps.

## Why It Matters

Instance methods sit at the heart of [Unit 1](/ap-comp-sci-a/unit-1 "fv-autolink") (Using Objects and Methods) and come back in Unit 3 (Class Creation). LO 1.14.A asks you to call instance methods and trace what they do, which is basically the job description of the first half of the course. Then Topic 3.7 flips the question and makes you contrast instance methods with static (class) methods. Per EK 3.7.A.1, a class method cannot touch instance variables or call instance methods unless an object is passed in as a [parameter](/ap-comp-sci-a/key-terms/parameter "fv-autolink"), so knowing which kind of method you're looking at tells you exactly what data it can reach. Almost every line of object-oriented code you read or write on this exam, from `String` methods to `ArrayList` methods to methods in classes you design yourself, runs through this concept.

## Connections

### Static (Class) Methods (Unit 3)

Static methods are the mirror image of instance methods. They belong to the class itself, so all objects share them, and they're called with the class name like `Math.sqrt(2)`. Because no specific object is attached, a [static method](/ap-comp-sci-a/key-terms/static-method "fv-autolink") can't access instance variables or call instance methods unless you hand it an object as a parameter (EK 3.7.A.1).

### [Dot Operator (Unit 1)](/ap-comp-sci-a/key-terms/dot-operator)

The [dot operator](/ap-comp-sci-a/key-terms/dot-operator "fv-autolink") is the syntax that makes instance methods work. `word.length()` reads as "go to the object that word refers to, and run length() on it." If you see objectName-dot-methodName, you're looking at an instance method call.

### [Null Reference (Unit 1)](/ap-comp-sci-a/key-terms/null-reference)

A [null reference](/ap-comp-sci-a/key-terms/null-reference "fv-autolink") points to no object at all, so there's nothing for an instance method to run on. Calling something like `word2.toUpperCase()` when word2 is null crashes with a NullPointerException (EK 1.14.A.2). That's why defensive code checks `if (word2 != null)` before making the call.

## On the AP Exam

Instance methods show up constantly in multiple-choice code traces. A classic stem gives you a `String` or `ArrayList` and a chain of calls like `numbers.add(10)`, `numbers.get(1)`, `numbers.set(0, value + 5)`, then asks what prints. You have to track how each call changes (or just reads) that specific object's state. Another favorite trap sets a reference to null and then calls a method on it, testing whether you know that produces a NullPointerException instead of output. In Unit 3 questions, you'll see a class definition like a `Counter` with `increment()` and `getValue()` and be asked which calls are legal or what the object's state is afterward. On the FRQs, especially Class design and Methods & Control Structures, you write instance methods yourself and call instance methods of other objects, so getting the object-dot-method pattern automatic is non-negotiable.

## instance method vs static method (class method)

An instance method is called on an object (`myCounter.increment()`) and can use that object's instance variables. A static method is called on the class (`Math.abs(-5)`) and cannot access instance variables or call instance methods at all, unless an object is passed to it as a parameter (EK 3.7.A.1). Quick check when reading code: name before the dot is an object, it's an instance method; name before the dot is a class, it's static.

## Key Takeaways

- An instance method belongs to an object and is called with the object name plus the dot operator, like myList.add(5).
- Instance methods can access and modify the instance variables of the specific object they're called on, which is how each object keeps its own state.
- Calling an instance method on a null reference throws a NullPointerException, a fact the exam tests over and over (EK 1.14.A.2).
- Static methods are the opposite case: they belong to the class, are called with the class name, and cannot touch instance variables or instance methods without being passed an object (EK 3.7.A.1).
- Methods you use all course long, like String's length() and substring() or ArrayList's add(), get(), and set(), are all instance methods.

## FAQs

### What is an instance method in AP Computer Science A?

It's a method that belongs to an object of a class and is called on that object using the dot operator, like word.length() or numbers.add(10). Because it runs on a specific object, it can read and change that object's instance variables (EK 1.14.A.1).

### What's the difference between an instance method and a static method?

An instance method is called on an object (c.increment()) and can use that object's instance variables. A static method is called on the class (Math.sqrt(2)) and can't access instance variables or call instance methods unless an object is passed in as a parameter (EK 3.7.A.1).

### Do you need to create an object to call an instance method?

Yes. Instance methods only run on actual objects, so you need a constructed object first, like Counter c = new Counter(0); before calling c.increment(). Static methods are the ones you can call without any object.

### What happens if you call an instance method on a null reference?

The program throws a NullPointerException (EK 1.14.A.2). If word2 is null, then word2.toUpperCase() crashes, which is exactly why exam code often checks if (word2 != null) before the call.

### Are ArrayList methods like add and get instance methods?

Yes. add(), get(), set(), size(), and remove() are all instance methods because you call them on a specific ArrayList object, like numbers.get(1). Each call affects only that one list.

## Related Study Guides

- [3.7 Static Variables and Methods](/ap-comp-sci-a/unit-3/static-variables-and-methods/study-guide/zzhHVbXBRCZQ7ng3EeWX)

## Structured Data

```json
{"@context":"https://schema.org","@graph":[{"@type":"LearningResource","@id":"https://fiveable.me/ap-comp-sci-a/key-terms/instance-method#resource","name":"Instance Method — AP CSA Definition & Exam Guide","url":"https://fiveable.me/ap-comp-sci-a/key-terms/instance-method","learningResourceType":"Concept explainer","educationalLevel":"AP® / High School","about":{"@id":"https://fiveable.me/ap-comp-sci-a/key-terms/instance-method#term"},"audience":{"@type":"EducationalAudience","educationalRole":"student"},"dateModified":"2026-06-11T05:27:19.499Z","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/instance-method#term","name":"instance method","description":"In AP Computer Science A, an instance method is a method that belongs to an object of a class and is called on that object with the dot operator (like word.length()), giving it access to that specific object's instance variables (EK 1.14.A.1).","url":"https://fiveable.me/ap-comp-sci-a/key-terms/instance-method","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 instance method in AP Computer Science A?","acceptedAnswer":{"@type":"Answer","text":"It's a method that belongs to an object of a class and is called on that object using the dot operator, like word.length() or numbers.add(10). Because it runs on a specific object, it can read and change that object's instance variables (EK 1.14.A.1)."}},{"@type":"Question","name":"What's the difference between an instance method and a static method?","acceptedAnswer":{"@type":"Answer","text":"An instance method is called on an object (c.increment()) and can use that object's instance variables. A static method is called on the class (Math.sqrt(2)) and can't access instance variables or call instance methods unless an object is passed in as a parameter (EK 3.7.A.1)."}},{"@type":"Question","name":"Do you need to create an object to call an instance method?","acceptedAnswer":{"@type":"Answer","text":"Yes. Instance methods only run on actual objects, so you need a constructed object first, like Counter c = new Counter(0); before calling c.increment(). Static methods are the ones you can call without any object."}},{"@type":"Question","name":"What happens if you call an instance method on a null reference?","acceptedAnswer":{"@type":"Answer","text":"The program throws a NullPointerException (EK 1.14.A.2). If word2 is null, then word2.toUpperCase() crashes, which is exactly why exam code often checks if (word2 != null) before the call."}},{"@type":"Question","name":"Are ArrayList methods like add and get instance methods?","acceptedAnswer":{"@type":"Answer","text":"Yes. add(), get(), set(), size(), and remove() are all instance methods because you call them on a specific ArrayList object, like numbers.get(1). Each call affects only that one list."}}]},{"@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":"Unit 3","item":"https://fiveable.me/ap-comp-sci-a/unit-3"},{"@type":"ListItem","position":4,"name":"instance method"}]}]}
```
