Last active
March 2, 2017 01:51
-
-
Save chingovan/a30103e834dd5cd9dc90af47c3644301 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SwapInt | |
public static void swap(int a, int b) { | |
int temp = a; | |
a = b; | |
b = temp; | |
} | |
//SwapPoint | |
public static void swap(Point a, Point b) { | |
Point temp = a; | |
a = b; | |
b = temp; | |
} | |
//SwapPointRef | |
public static void swap(Point a, Point b) { | |
int temp = a.getX(); | |
a.setX(b.getX()); | |
b.setX(temp); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment