---
title: "Does Java pass by reference or pass by value?"
url: https://daily.dev/posts/does-java-pass-by-reference-or-pass-by-value--aqblalga1
source_url: https://www.infoworld.com/article/3512039/does-java-pass-by-reference-or-pass-by-value.html
type: article
source: "Java World"
published: 2024-06-06T09:02:34.174Z
updated: 2024-10-05T16:47:48.648Z
tags: ["java"]
reading_time: 7
upvotes: 4
comments: 1
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Does Java pass by reference or pass by value?

**[Java World](https://daily.dev/sources/javaworld)** · 7 min read · 4 upvotes · 1 comments

## Summary

This post discusses the concept of passing by reference and passing by value in Java, specifically for object parameters. It explains that Java passes object references by value, and provides examples of passing object references, passing primitive types, passing immutable object references, and passing mutable object references. The post also includes tips on what to avoid and what to remember when passing Java object references.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.infoworld.com/article/3512039/does-java-pass-by-reference-or-pass-by-value.html>

## Community discussion

Top comments from developers on daily.dev.

**@vineeththota** · 1 upvotes

> primitives by value, objects by reference ( aliasing ), primitives are cheap and objects are expensive ( on memory ).

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 0 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments
- [CNCF Unveils Schedule for KubeCon \+ CloudNativeCon Europe 2026](https://daily.dev/posts/cncf-unveils-schedule-for-kubecon-cloudnativecon-europe-2026-ikhcoa5cb) · CNCF · 2 upvotes · 0 comments
- [CNCF Debuts KubeCon \+ CloudNativeCon Japan 2026 Schedule](https://daily.dev/posts/cncf-debuts-kubecon-cloudnativecon-japan-2026-schedule-xp5pyudub) · CNCF · 1 upvotes · 0 comments

---

Tags: [#java](https://daily.dev/tags/java)

[View this post on daily.dev](https://daily.dev/posts/does-java-pass-by-reference-or-pass-by-value--aqblalga1)
