Monday, May 8, 2023

Java list fast code ordering

Using javaon backend programming if you have to order a list using a list object attribute you can use stream:

Collections.sort(<List>, Comparator.comparing(<List Object>::<filed getter method>));

follow an example


No comments:

Post a Comment