Java Array Sort sort(String[] strArray)

Here you can find the source of sort(String[] strArray)

Description

sort

License

Open Source License

Declaration

public static final String[] sort(String[] strArray) 

Method Source Code

//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;
    }
}

Related

  1. sort(String a[])
  2. sort(String[] colnos)
  3. sort(String[] s)
  4. sort(String[] sArray)
  5. sort(String[] str)
  6. sort(String[] strArray)
  7. sort(T[] a, S[] a2)
  8. sort(T[] array)
  9. sort(T[] array)