Here you can find the source of sort(T[] array)
public static <T> T[] sort(T[] array)
//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; } }