2 ms·
You can't write swap in Java as defined by the article - one that changes the values of the parameters. Your swap only follows the pointers and changes the poin
by jjnoakes 12y ago
You can't write swap in Java as defined by the article - one that changes the values of the parameters. Your swap only follows the pointers and changes the pointed-to objects.
A valid, real "swap" in Java is one that passes my example code and prints "real pass-by-reference swap" and not "fake pass-by-value swap'.