Lots of people get very confused about that. There are lots of explanations in this thread
Joined: Dec 23, 2003
Paul Clapham wrote:No, it's much simpler than that. It's because all parameters are always passed by value in Java. You can read this Ranch campfire story which explains why that is.
Thanks. Lots of discussions.
as said: "For references to objects, you pass a copy of the reference (the remote control)", reference is the address of the object, so we can say pass by object (reference), On the other side, reference is address, (0x1234), still is a value, so we can say we are passing a value. From this point of view, no any different.
Another question, Integer is an immutable class, like String ?