开发工具:
文件大小: 194kb
下载次数: 0
上传时间: 2019-10-31
详细说明:Lambda表达式之集合操作,代码里主要针对java 集合list的操作public static class Studentt
8
private Long id
private String name;
private Integer age;
public Student (Long id, String name, Integer age)i
this id= id
this name name
his age age;
public Long getIdo i
turn id:
public void setId(Long id)i
this. id= id:
public String getName(t
99
return name
⊥⊙⊙
101
102
public void setName(string name )t
103
this name name;
1⊙6
public Integer getAge()[
return agei
⊥⊥⊙
public void setAge (Integer age)[
111
thisa
age
113
116
1学生原数据:[{"nane":"张","id":1,"age":15},"name":"李
四","id":2,"age":11},{"name":"王五","id":3,"age":12},"name":"赵
六","id":4,"age":10}]
3查出姓名是“张三”的学生:[name":"张三","id":1,"age":15}
取出学生的年龄集合:[15,11,12,10
5取出学生的年龄集合并去重:[15,11,12,10
6学生集合里去除前三个:[{"name";"赵六","id":4,"age":10}]
7学生集合里取前三个:[{"name":"张三","id":1,"age":15},"name":"李
川","id":2
2}]
根据学生年龄分组:{"11:[{"nane":"李四","id":2,"age":11}],"12":[{"hane":"王
五","id":3,"age":12}],"15":["name":"张三","id":L,"age":15}],"1":
[{"name":"赵六","id":4,"age":10}]}
9找出学生年龄之和:48
0找出学生年龄最大:15
11找出学生年龄最小:10
12找出学生年龄最小:12.0
13根据学生年龄降序:["name":"张三","id":1,"age":15},{"name":"王
五","id":3,"age":12},"name":"李四","id":2,"age":11},{"nane":"赵
六","id":4,"age":10}]
14根据学生年龄升序:["nane":"赵六","id":4,"age":10},{"name":"李
四","id":2,"age":11},f"name":"王五","id":3,"age":12}," name":"张
,"id":1,"age":15}]
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.