About 54 results
Open links in new tab
  1. java - How to sort a List/ArrayList? - Stack Overflow

    Apr 27, 2013 · Collections.sort allows you to pass an instance of a Comparator which defines the sorting logic. So instead of sorting the list in natural order and then reversing it, one can simply pass …

  2. sorting - How to sort an ArrayList in Java - Stack Overflow

    Aug 26, 2013 · How to sort an ArrayList in Java [duplicate] Asked 12 years, 6 months ago Modified 6 years, 6 months ago Viewed 629k times

  3. java - How to sort Arraylist of objects - Stack Overflow

    I have ArrayList, which containst football teams (class Team). Teams have points and i want to sort them by number of points. public class Team { private int points; private String name...

  4. Sorting ArrayList with Lambda in Java 8 - Stack Overflow

    Jul 24, 2017 · Could somebody show me a quick example how to sort an ArrayList alphabetically in Java 8 using the new lambda syntax.

  5. Método sort para ordenar el ArrayList en Java

    The method sort (Comparator<? super Integer>) in the type ArrayList<Integer> is not applicable for the arguments () ¿Cómo hago para aplicar ese método sort a la lista?

  6. java - Sorting an ArrayList of objects using a custom sorting order ...

    May 6, 2015 · I am looking to implement a sort feature for my address book application. I want to sort an ArrayList&lt;Contact&gt; contactArray. Contact is a class which contains four fields: name, home …

  7. data structures - Sorted array list in Java - Stack Overflow

    Oct 27, 2010 · I'm essentially looking for a datastructure in Java which implements the java.util.List interface, but which stores its members in a sorted order. I know that you can use a normal ArrayList …

  8. java - How to sort an ArrayList without the built-in sort () function ...

    May 9, 2012 · 4 Assuming "in-built sort" refers to Collections.sort () and you are fine with the sorting algorithm you have implemented, you can just convert your sorted array into an ArrayList

  9. Java, how to use compareTo to sort an Arraylist - Stack Overflow

    Im trying to figure out how to sort an ArrayList using comparable, my code looks like this: public class playerComparsion { public static void main (String [] args) { ArrayList<O...

  10. java - How to sort ArrayList<Long> in decreasing order? - Stack Overflow

    May 5, 2011 · 0 You can also sort an ArrayList with a TreeSet instead of a comparator. Here's an example from a question I had before for an integer array. I'm using "numbers" as a placeholder …