Created
March 2, 2017 01:37
-
-
Save chingovan/c19cb97b310c3bdc63f99292d63a9184 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
/** | |
* Created by ChiNV on 3/2/2017. | |
*/ | |
public class SwapPoint { | |
public static void swap(Point a, Point b) { | |
Point temp = a; | |
a = b; | |
b = temp; | |
} | |
public static void main(String[] argv) { | |
Point c = new Point(1); | |
Point d = new Point(2); | |
System.out.println("c: " + c); | |
System.out.println("d: " + d); | |
swap(c, d); | |
System.out.println("c: " + c); | |
System.out.println("d: " + d); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment