3 ms·
The answer Gosling actually gives in your link is "Depends on your terminology"; he acknowledges it "behaves like pass-by-reference". You say "pass by reference
by lmm 9y ago
The answer Gosling actually gives in your link is "Depends on your terminology"; he acknowledges it "behaves like pass-by-reference". You say "pass by reference properly means that when an argument is passed to a function, the invoked function gets a reference to the original value, not a copy of its value. If the function modifies its parameter, the value in the calling code will be changed because the argument and parameter use the same slot in memory" - but this is the behavior of Java. Gosling talks about "the pointer" because he's thinking in terms of the implementation, but that can't be the correct answer in the context of Java because pointers don't exist in the language.