为了账号安全,请及时绑定邮箱和手机立即绑定

lambda表达式的方法引用

lambda表达式的方法引用

fenkapian 2017-12-25 22:53:47
Collections.sort(employees,  (x, y) -> {    if (x.getAge() == y.getAge()) {        return -x.getName().compareTo(y.getName());    } else {        return -Integer.compare(x.getAge(), y.getAge());    }});这代码怎么用方法引用精简一下呢?
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 1040 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信