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

I always thought Java uses pass-by-reference.

However, I’ve seen a blog post that claims that Java uses pass-by-value.

I don’t think I understand the distinction they’re making.

What is the explanation?

Leave a Comment