Java Array Swap swap(int[] integers, int positionX, int positionY)

Here you can find the source of swap(int[] integers, int positionX, int positionY)

Description

swap

License

Open Source License

Declaration

public static int[] swap(int[] integers, int positionX, int positionY) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static int[] swap(int[] integers, int positionX, int positionY) {
        int temp = integers[positionX];
        integers[positionX] = integers[positionY];
        integers[positionY] = temp;/* w  ww .java 2s  . co m*/
        return integers;
    }
}

Related

  1. swap(int[] array, int i, int j)
  2. swap(int[] array, int idx1, int idx2)
  3. swap(int[] array, int index0, int index1)
  4. swap(int[] array, int x, int y)
  5. swap(int[] inArray, int index1, int index2)
  6. swap(int[] list, int i, int j)
  7. swap(long[] a, int i, int change)
  8. swap(long[] keys, double[] values, int i, int j)
  9. swap(Object aobj[], int i, int j, int k)