Sort List of objects by a particular rule?

前端 未结 3 1621
悲&欢浪女
悲&欢浪女 2020-12-22 04:00

I have this list:

List countryList = new ArrayList();

And I want to sort the countries by their name, by usin

3条回答
  •  無奈伤痛
    2020-12-22 04:18

    You can call Collections.sort() providing a Comparator which compares the getCountry().

提交回复
热议问题