3 ms·
That's true. I think this article is being a bit pedantic on this point. You can never have a variable that directly represents an object in Java. You can only
by mmastrac 15y ago
That's true. I think this article is being a bit pedantic on this point.
You can never have a variable that directly represents an object in Java. You can only ever hold a reference to an object. Those references to objects are passed by value.
So his statement is more technically correct, but in general "objects are passed by reference and scalars by value" is the understanding that an interviewer would likely be looking for.