|
|
|
|
|
by mattnewport
794 days ago
|
|
That's only because strings are immutable in Java. It's not true for reference types in general. In C++ passing a pointer by value is effectively the same as passing a reference, the only real difference being that the syntax for accessing the underlying value is more implicit for a reference. |
|
This is also true when passing a pointer variable by value in C or C++. It is not true when passing a reference in C++ - the receiving method can change which object the original variable points to.