Computer Science, asked by Inna4453, 1 year ago

In swap method why is the same value after swapping method in main method

Answers

Answered by Anonymous
13

Here's a method to swap two variables in java in just one line using bitwise XOR(^) operator. There are no pointers in Java. However, every variable that "contains" an object is a reference to that object. To have output parameters, you would have to use objects.

Similar questions