Java Array Sort sort(T[] array)

Here you can find the source of sort(T[] array)

Description

sort

License

Apache License

Declaration

public static <T> T[] sort(T[] array) 

Method Source Code

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

import java.util.Arrays;

import java.util.Comparator;

public class Main {

    public static <T> T[] sort(T[] array) {
        T[] output = Arrays.copyOf(array, array.length);
        Arrays.sort(output);/*from  ww  w .  j a v  a2  s.com*/
        return output;
    }

    public static <T> T[] sort(T[] array, Comparator<? super T> c) {
        T[] output = Arrays.copyOf(array, array.length);
        Arrays.sort(output, c);
        return output;
    }
}

Related

  1. sort(String[] str)
  2. sort(String[] strArray)
  3. sort(String[] strArray)
  4. sort(T[] a, S[] a2)
  5. sort(T[] array)
  6. sort(T[] array)
  7. sort(T[] array, boolean nullsFirst)
  8. sort(T[] src)
  9. sort1(int x[], int off, int len, int y[])