Last active
March 2, 2017 01:34
-
-
Save chingovan/c13d66b44cccc891ac5d8d6830956a6c 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
public class SwapInt { | |
public static void swap(int a, int b) { | |
int temp = a; | |
a = b; | |
b = temp; | |
} | |
public static void main(String[] argv) { | |
int c = 1; | |
int d = 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