Quantcast
Channel: How to sort List of objects by some property - Stack Overflow
Viewing all articles
Browse latest Browse all 19

How to sort List of objects by some property

$
0
0

I have simple class

public class ActiveAlarm {    public long timeStarted;    public long timeEnded;    private String name = "";    private String description = "";    private String event;    private boolean live = false;}

and List<ActiveAlarm> con. How to sort in ascending order by timeStarted, then by timeEnded? Can anybody help? I know in C++ with generic algorithm and overload operator <, but I am new to Java.


Viewing all articles
Browse latest Browse all 19

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>