Java Collection Sort sorted(Collection c)

Here you can find the source of sorted(Collection c)

Description

sorted

License

Apache License

Declaration

public static <T extends Comparable<? super T>> List<T> sorted(Collection<T> c) 

Method Source Code


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

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class Main {
    public static <T extends Comparable<? super T>> List<T> sorted(Collection<T> c) {
        ArrayList<T> list = new ArrayList<T>(c);
        Collections.sort(list);//from  w w  w  .  ja va  2s  .c om
        return list;
    }
}

Related

  1. sorted(Collection input)
  2. sorted(Collection coll)
  3. sorted(Collection collection)
  4. sorted(Collection ss)
  5. sorted(Collection c)
  6. sorted(Collection collection)
  7. sortedByName(Collection unsorted, Comparator comparator, T... exclusions)
  8. sortedCollection(final Comparator comparator, final Collection input)
  9. sortedIfPossible(Collection collection)