|
|
|
|
|
by okmjuhb
5672 days ago
|
|
This is not at all correct because passing by reference and value have defined and distinct meanings. Consider the difference between C++, which has actual pass by reference:
void swap(int& x, int& y) { int t = x; x = y; y = t; }, and Java: void swap(Integer x, Integer y) { Integer t = x, x = y; y = t; }. The C++ version will result in changes to the variables in the calling function and the Java version will not. The real problem is that Java created needless confusion by calling its pointers references for purely marketing reasons. |
|