posted 19 years ago
If you're from a C++ background, you may be envisioning something like this:
Alas, you cannot have a method with precisely those semantics in Java.
You'll have to use a temporary variable to swap two variables.
If you'd like to swap two items in an array, you can just do what comes naturally: