Categories
How to sort list element from objects by value?
There is a list array ArrayList<Article> list. The Article object has a date variable. How to sort these objects in list by date value - oldest first and oldest last?
ArrayList<Article> list
Answer the question
In order to leave comments, you need to log in
list.sort(Comparator.comparing(Article::getPubDate));
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question