Here you can find the source of swap(int[] integers, int positionX, int positionY)
public static int[] swap(int[] integers, int positionX, int positionY)
//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; } }