Sort an ArrayList of objects?

后端 未结 7 1848
轻奢々
轻奢々 2021-01-29 01:47

I need some help how to sort an ArrayList of objects. I have the superclass Account and two subclasses SavingsAccount and CreditAccount. Inside the Account class I have this met

7条回答
  •  天命终不由人
    2021-01-29 02:06

    You can use sort method in Collections utility and your custom implementation of Comparator interface.

提交回复
热议问题