- 链接地址:https://blog.csdn.net/weixin_34175509/article/details/85915335
- 链接标题:scala中获取Map中key和value的方法-CSDN博客
- 所属网站:blog.csdn.net
- 被收藏次数:9549
文章浏览阅读4.5k次。val scores=Map("Alice"->10,"Bob"->3,"Cindy"->8)// 获取所有的key val nameList=scores.map(_._1)// map 函数返回List println(nameList.getClass)遍历list中的元素 nameList.foreach((x:St..._scala 获取map的key
版权声明:本文发布于特牛网址导航 内容均来源于互联网 如有侵权联系删除