Languagemedium0-2 years

Is Java pass-by-value or pass-by-reference?

Pass-by-value, always. For an object, the value that is copied is the reference — so a method can mutate the object the caller holds, but reassigning the parameter changes nothing outside the method.

The lesson behind it →
More on Language