Technology

Sorting list with nulls as higher value

I had a list of Strings and wanted to sort them but pay special attention to null values. See the default sorting in demonstration : [groovy] List<String> animals=["Monkey", null, "Ape", null, "Tiger", "Lion"] println animals.sort() ...

by Bhagwat Kumar
Tag: null as lowest value
25-Sep-2012