Well, all in favour of FAQs, except when they're misleading...
In short in java, object references are passed by reference and primitive types are passed by value.
What? Java always passes by value.
Object references are passed by value. The callee gets a new copy of the object reference, which the callee may change without affecting the caller.
In Java you can't have variables that are objects. You can only have variables that are object
references.
Some people like to say that, when passing an object reference by value to a method, they are effectively passing the object by reference. If you're one of those people, the FAQ could more correctly say: -
In short in java, objects are passed by reference and primitive types are passed by value.
[ May 03, 2007: Message edited by: Peter Chase ]