Here you can find the source of sort(List
public static <T extends Comparable<? super T>> void sort(List<T> list)
//package com.java2s; //License from project: Apache License import java.util.Collections; import java.util.Comparator; import java.util.List; public class Main { public static <T extends Comparable<? super T>> void sort(List<T> list) { Collections.sort(list);//from w w w . j av a2s . c o m } public static <T> void sort(List<T> list, Comparator<? super T> c) { Collections.sort(list, c); } }