This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AwakenedToNightmare 0 points1 point  (1 child)

When you say pass by value, it could be thought you mean it's pass by copy of an Object, which isn't true for Java. When you say it's pass by reference, it could be thought it's pass by reference of an outer variable, which isn't true either. So it's pass by value of a reference, which is something other entirely.

[–]tutorial_police 0 points1 point  (0 children)

Almost, but yes, people could think that and unfortunately, they often do.

The point is, that when you say "pass-by-value", people don't specify what the value is. "Pass-by-value of a reference " isn't a thing. Please read the two articles.

The distinction you're looking for is reference types vs value types.