3 ms·
It isn't "if the value is an object then scope gets a copy of the reference" No new objects are created when you pass an object. An object's value is a memory
by k2xl 9y ago
It isn't "if the value is an object then scope gets a copy of the reference" No new objects are created when you pass an object.
An object's value is a memory location. When you pass it as an argument you're passing that value into the method. The analogy is more akin to casting than copying.