Java hashmap值结构 [英] Java hashmap value structure

查看:59
本文介绍了Java hashmap值结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在浏览哈希地图链接..此方法在其签名中将Collection作为其返回类型..不是Collection是集,列表,映射的接口吗?这种方法到底是什么回归?我有兴趣知道返回类型的HashMap.values()的结构..我知道它返回hashmap中的总值但我想知道这些值是如何返回的..它是以set的形式吗?



提前致谢!



我的尝试:



我试图理解HashMap.values()的返回类型

I was going through the link HashMap .. This method has Collection as its return type in its signature.. Are not Collection an interface for sets, lists, maps? What exactly is this method returning? I am interested in knowing the structure of the returned type of HashMap.values().. I know it returns the total values in hashmap but I want to know how are these values returned.. Is it in the form of set?

Thanks In Advance!

What I have tried:

I am trying to understand the return type of HashMap.values()

推荐答案

它返回一个查看 HashMap 符合集合界面。

好​​吧,它比听起来更简单......粗略地说'价值集'(它不是一套,因为不得独一无二),即 iterable 方式中的所有值。
It returns a view of the values of the HashMap conforming to the Collection interface.
Well, it is more simple than it sounds... Roughly speaking the 'collection of values' (it is not a set, because values have NOT to be unique), that is all the values in iterable fashion.


这篇关于Java hashmap值结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆