Java Array Swap swap(final int[] array, final int indexA, final int indexB)

Here you can find the source of swap(final int[] array, final int indexA, final int indexB)

Description

swap

License

Apache License

Declaration

public static void swap(final int[] array, final int indexA, final int indexB) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static void swap(final int[] array, final int indexA, final int indexB) {
        int t = array[indexA];
        array[indexA] = array[indexB];/* w w w . ja  va  2s  . c  o  m*/
        array[indexB] = t;
    }
}

Related

  1. swap(final byte[] array, int firstIndex, int secondIndex)
  2. swap(final byte[] src)
  3. swap(final float[] pVertices, final int pVertexStride, final int pVertexIndexA, final int pVertexIndexB)
  4. swap(final int a[], final int i, final int j)
  5. swap(final int[] array, final int i, final int j)
  6. swap(final int[] array, final int pos1, final int pos2)
  7. swap(final Object[] array, final int i, final int j)
  8. swap(final Object[] array, int offset1, int offset2)
  9. swap(final Object[] array, int pos)