我有一个Arraylist,我想通过两个属性对ArrayList进行排序 1.姓名(按字母顺序排列) 2.通过自定义键
更多说明 - :
ArrayList<User> list = new ArrayList();
Collections.sort(list, new Comparator<User>() {
@Override
public int compare(User user, User t1) {
1.By User.getName() (Alphabetically)
2.By User.getRelationshipState() (Custom property)
});
`