Java Array Sort sort(String a[])

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

Description

sort

License

Apache License

Declaration

public static void sort(String a[]) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static void sort(String a[]) {
        for (int i = 0; i < a.length - 1; i++) {
            for (int j = i + 1; j < a.length; j++) {
                if (a[j].compareTo(a[i]) < 0) {
                    String temp = a[i];
                    a[i] = a[j];/*from w  ww . ja va2s  .c  o  m*/
                    a[j] = temp;
                }
            }
        }
    }
}

Related

  1. sort(Object[] arr, int start, int end)
  2. sort(Object[] array)
  3. sort(Object[] array, Comparator comparator)
  4. sort(Object[] array, int start, int end)
  5. sort(Object[] array_, boolean accendingOrder_)
  6. sort(String[] colnos)
  7. sort(String[] s)
  8. sort(String[] sArray)
  9. sort(String[] str)