Here you can find the source of sortArray(int[] array)
public static void sortArray(int[] array)
//package com.java2s; public class Main { /**//from ww w . j a v a 2 s . c om * Basic sort for small arrays of int. */ public static void sortArray(int[] array) { boolean swapped; do { swapped = false; for (int i = 0; i < array.length - 1; i++) { if (array[i] > array[i + 1]) { int temp = array[i + 1]; array[i + 1] = array[i]; array[i] = temp; swapped = true; } } } while (swapped); } }