Here you can find the source of swap(T[] ts, int i, int j)
static <T> void swap(T[] ts, int i, int j)
//package com.java2s; //License from project: Apache License public class Main { static <T> void swap(T[] ts, int i, int j) { T tmp = ts[i];// w ww .j a v a 2 s . c o m ts[i] = ts[j]; ts[j] = tmp; } static void swap(int[] ts, int i, int j) { int tmp = ts[i]; ts[i] = ts[j]; ts[j] = tmp; } static void swap(byte[] ts, int i, int j) { byte tmp = ts[i]; ts[i] = ts[j]; ts[j] = tmp; } }