欢迎光临散文网 会员登陆 & 注册

马老师gradLe+groovy实战教程

2023-04-04 10:39 作者:亲爱的小聪聪  | 我要投稿

试试。

//给List赋值
List<User> list = getList();
//新的list
List<User> newList= new ArrayList<>();
for (User user: list) {
if (user.getAge() >= 21){
newList.add(user);
}


马老师gradLe+groovy实战教程的评论 (共 条)

分享到微博请遵守国家法律