---
title: "Call by Value — AP Comp Sci A Definition & Exam Guide"
description: "Call by value means Java copies an argument's value into a method's parameter. It explains why reassigning a parameter never changes the original variable."
canonical: "https://fiveable.me/ap-comp-sci-a/key-terms/call-by-value"
type: "key-term"
subject: "AP Computer Science A"
unit: "Unit 1"
---

# Call by Value — AP Comp Sci A Definition & Exam Guide

## Definition

Call by value is Java's parameter-passing rule: when you call a method or constructor, each argument's value is copied into the corresponding parameter. The parameter is a separate variable, so reassigning it inside the method does not change the original argument.

## What It Is

Call by value is how Java hands arguments to [methods](/ap-comp-sci-a/unit-3/abstraction-and-program-design/study-guide/o9VgVeIpKRYZ7N7rXfUz "fv-autolink") and constructors. When you write `modify(num)`, Java doesn't send the variable `num` itself. It makes a copy of the value stored in `num` and puts that copy into the [parameter](/ap-comp-sci-a/key-terms/parameter "fv-autolink"). The parameter and the original variable are two different boxes that happen to start with the same contents.

This is true for every call in Java, including [constructor](/ap-comp-sci-a/unit-1/creating-and-storing-objects/study-guide/rUOTKl6Ih5noXJ0GtxJF "fv-autolink") calls (EK 1.13.C.3). For a primitive like an `int`, the copied value is the number itself, so nothing the method does can touch the caller's variable. For an object, the copied value is the *reference* (the address of the object). The method gets its own copy of that reference, but both copies point to the same object. That one distinction explains most of the tricky parameter questions you'll see.

## Why It Matters

Call by value lives in [Unit 1](/ap-comp-sci-a/unit-1 "fv-autolink") (Using Objects and Methods), specifically Topic 1.9 (Calling a Void Method With Parameters) and Topic 1.13 (Creating and Storing Objects). It supports learning objectives 1.9.B (describe how to call methods) and 1.13.C (create an [object](/ap-comp-sci-a/key-terms/object "fv-autolink") by calling a constructor), where the CED states directly that arguments are passed using call by value. It also leans on 1.13.B, since you can't reason about passing objects without knowing that a reference-type variable holds an object reference. This concept is the foundation for every code-tracing question that asks "what prints?" after a method call. If you don't know that parameters are copies, you'll predict the wrong output again and again.

## Connections

### [Object reference (Unit 1)](/ap-comp-sci-a/key-terms/object-reference)

This is the concept call by value gets tangled with most. When an object is the [argument](/ap-comp-sci-a/key-terms/argument "fv-autolink"), Java copies the reference, not the object. So the method can change the object's attributes (both references point to the same object), but it can't make the caller's variable point somewhere new. Copy of the address, same house.

### [Argument (Unit 1)](/ap-comp-sci-a/key-terms/argument)

Arguments are the values you pass in; parameters are the variables that receive the copies. Call by value is the handoff rule between them. EK 1.9.B.3 requires arguments to match the [parameter list](/ap-comp-sci-a/key-terms/parameter-list "fv-autolink") in number, order, and type, and call by value is what happens once they match.

### [Object construction (Unit 1)](/ap-comp-sci-a/key-terms/object-construction)

Constructors follow the exact same rule as methods. When you write `new Dog("Rex", 3)`, copies of those argument values initialize the constructor's parameters, which then set the object's [attributes](/ap-comp-sci-a/key-terms/attribute "fv-autolink") (EK 1.13.C.2 and 1.13.C.3). One rule, every call.

## On the AP Exam

Call by value shows up as code-tracing multiple choice. A classic stem gives you a method like `public static void modify(int x) { x = x * 2; }`, calls it with `modify(num)` where `num` is 5, then prints `num`. The answer is 5, because `x` was only ever a copy. A second classic gives a non-void method like `square(value)` called without storing the result. The original variable still prints unchanged, because the return value was thrown away and `value` was never touched. On FRQs, call by value is implicit rather than named. Every method you write receives copies of its arguments, so don't expect reassigning a parameter to change anything in the caller. The skill you actually need is tracing: track the parameter as its own variable, separate from the argument.

## call by value vs Call by reference

Java does not have call by reference, full stop. The confusion comes from objects: when you pass an object, the *reference* is copied by value. The method's parameter points to the same object, so calling a mutator like `dog.setName("Rex")` inside the method changes the real object. But reassigning the parameter (`dog = new Dog()`) only redirects the copy and leaves the caller's variable alone. True call by reference would let the method reassign the caller's variable. Java never does that.

## Key Takeaways

- Every method and constructor call in Java passes arguments by value, meaning the parameter gets a copy of the argument.
- Reassigning a parameter inside a method never changes the original variable in the caller.
- When an object is passed, the reference is copied, so the method can modify the object's state but cannot make the caller's variable point to a different object.
- If a non-void method's return value isn't stored or used, the original variable stays unchanged, so `square(value)` alone does nothing to `value`.
- Constructor arguments follow the same call-by-value rule as method arguments (EK 1.13.C.3).

## FAQs

### What is call by value in Java for AP Computer Science A?

Call by value means Java copies each argument's value into the method or constructor's parameter when a call happens. The parameter is an independent variable, so changes to it don't affect the original argument. The CED states this rule explicitly in Topics 1.9 and 1.13.

### Is Java call by value or call by reference?

Java is always call by value, even for objects. What gets copied for an object is the reference, which is why a method can mutate the object but can't reassign the caller's variable. "Java passes object references by value" is the precise way to say it.

### Can a method change a variable passed into it?

Not if it's a primitive. In the classic exam example, `modify(num)` doubles its parameter `x`, but `num` still prints 5 afterward because `x` was a copy. For objects, the method can change the object's attributes but not which object the caller's variable refers to.

### How is call by value different from passing an object reference?

They're not opposites. Passing an object reference IS call by value: the reference itself gets copied. Both the argument and the parameter then point to the same object, so mutator methods affect the original object even though no variable was shared.

### Why doesn't square(value) change value in my code?

Two reasons. First, call by value means `value` was never sent into the method, only a copy of 4 was. Second, `square` returns a result, and a return value must be stored in a variable or used in an expression (EK 1.9.B.2). Calling it on its own line just discards the 16.

## Related Study Guides

- [1.13 Creating and Storing Objects](/ap-comp-sci-a/unit-1/creating-and-storing-objects/study-guide/rUOTKl6Ih5noXJ0GtxJF)

## Structured Data

```json
{"@context":"https://schema.org","@graph":[{"@type":"LearningResource","@id":"https://fiveable.me/ap-comp-sci-a/key-terms/call-by-value#resource","name":"Call by Value — AP Comp Sci A Definition & Exam Guide","url":"https://fiveable.me/ap-comp-sci-a/key-terms/call-by-value","learningResourceType":"Concept explainer","educationalLevel":"AP® / High School","about":{"@id":"https://fiveable.me/ap-comp-sci-a/key-terms/call-by-value#term"},"audience":{"@type":"EducationalAudience","educationalRole":"student"},"dateModified":"2026-06-11T05:27:18.766Z","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/call-by-value#term","name":"call by value","description":"Call by value is Java's parameter-passing rule: when you call a method or constructor, each argument's value is copied into the corresponding parameter. The parameter is a separate variable, so reassigning it inside the method does not change the original argument.","url":"https://fiveable.me/ap-comp-sci-a/key-terms/call-by-value","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 call by value in Java for AP Computer Science A?","acceptedAnswer":{"@type":"Answer","text":"Call by value means Java copies each argument's value into the method or constructor's parameter when a call happens. The parameter is an independent variable, so changes to it don't affect the original argument. The CED states this rule explicitly in Topics 1.9 and 1.13."}},{"@type":"Question","name":"Is Java call by value or call by reference?","acceptedAnswer":{"@type":"Answer","text":"Java is always call by value, even for objects. What gets copied for an object is the reference, which is why a method can mutate the object but can't reassign the caller's variable. \"Java passes object references by value\" is the precise way to say it."}},{"@type":"Question","name":"Can a method change a variable passed into it?","acceptedAnswer":{"@type":"Answer","text":"Not if it's a primitive. In the classic exam example, `modify(num)` doubles its parameter `x`, but `num` still prints 5 afterward because `x` was a copy. For objects, the method can change the object's attributes but not which object the caller's variable refers to."}},{"@type":"Question","name":"How is call by value different from passing an object reference?","acceptedAnswer":{"@type":"Answer","text":"They're not opposites. Passing an object reference IS call by value: the reference itself gets copied. Both the argument and the parameter then point to the same object, so mutator methods affect the original object even though no variable was shared."}},{"@type":"Question","name":"Why doesn't square(value) change value in my code?","acceptedAnswer":{"@type":"Answer","text":"Two reasons. First, call by value means `value` was never sent into the method, only a copy of 4 was. Second, `square` returns a result, and a return value must be stored in a variable or used in an expression (EK 1.9.B.2). Calling it on its own line just discards the 16."}}]},{"@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 1","item":"https://fiveable.me/ap-comp-sci-a/unit-1"},{"@type":"ListItem","position":4,"name":"call by value"}]}]}
```
