在Java 8中可以通过下面的方式获取Map对象的第一个元素:
1.获取元素键
//if order is important, e.g. with a TreeMap/LinkedHashMap
map.keySet().stream().findFirst();
//if order is not important or with unordered maps (HashMap...)
map.keySet().stream().findAny();
2.获取元素键值
//if order is important, e.g. with a TreeMap/LinkedHashMap
map.values().stream().findFirst();
//if order is not important or with unordered maps (HashMap...)
map.values().stream().findAny();
3.获取元素
//if order is important, e.g. with a TreeMap/LinkedHashMap
map.entrySet().stream().findFirst();
//if order is not important or with unordered maps (HashMap...)
map.entrySet().stream().findAny();
References
最新评论
能弄个电视apk 就好了
求分享站点。https://www.ziyedm.com 子夜动漫 无广告,更新及时
+62 +63 都不行 一直邮箱 验证也上不去 要么就呼叫来电 或者发送到另一台设备 但是另一台设备没有收到码 这个文章也看过了
telegram x接不到验证码