Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SwapTester
- {
- /**
- Swaps two values
- @param array an array of length 2 containing the
- values to be swapped
- */
- public static void trueSwap(int[] array)
- {
- System.out.print(array[1]);
- System.out.print(" ");
- System.out.println(array[0]);
- }
- public static void main(String[] args)
- {
- int[] xy = new int[2];
- xy[0] = 3;
- xy[1] = 4;
- trueSwap(xy);
- System.out.println("Expected: 4 3");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement