Here you can find the source of sort(String[] strArray)
public static final String[] sort(String[] strArray)
//package com.java2s; public class Main { public static final String[] sort(String[] strArray) { if (strArray == null) return null; String tmp = ""; for (int i = 0; i < strArray.length; i++) { for (int j = 0; j < strArray.length - i - 1; j++) { if (strArray[j].compareTo(strArray[j + 1]) < 0) { tmp = strArray[j];// w ww.j a va 2 s . com strArray[j] = strArray[j + 1]; strArray[j + 1] = tmp; } } } return strArray; } }