The references are passed by value, but the objects are passed by reference.

See this thread for a discussion on terminology
http://www.codeguru.com/forum/showth...hreadid=277180

Some objects are constant in that they do not allow their users to modify their state: all the primitive wrappers, String, the additional number classes. Even if they are passed by reference (as they are), you cannot modify them. It's like passing a pointer to an object in C++, where the object pointed to has a private assignment operator, no public properties and no methods that modify any internal values. You can change the pointer, but not the object. Still, the object was passed by reference.

But you can for example pass a StringBuffer to a function and modify it there. The modification will be visible outside the function because the StringBuffer was passed by reference. To pass an object "pseudo-by-value", you have to do something like
Code:
StringBuffer sb = new StrinBuffer();
wantsByValue((StringBuffer)sb.clone());
The other one is to create a new vector on the heap in the function and then return a pointer to it.
Something I don't like at all. I can't stand functions that allocate stuff and return a pointer to it if there is no logical end function that deletes the memory.