Java中的map size()方法示例。

huangapple go评论66阅读模式
英文:

Map size() Method in Java With Examples

问题

我非常努力地尝试了解Map size()方法。但我没有找到任何合适的内容。请用适当的定义、语法、参数、异常等来解释这个方法。

英文:

I tried very hard to know Map size() method. But i didn't find any proper content. Please Explain the method with proper definition, syntax, parameters, Exceptions, etc.

答案1

得分: 1

查看Map类的文档,您可以找到size()方法的定义:

返回此映射中键-值映射的数量。如果映射包含超过Integer.MAX_VALUE个元素,则返回Integer.MAX_VALUE。

它没有任何参数,也不会抛出异常。

总的来说,文档是您的朋友。您可以通过搜索“java ”轻松找到要了解更多信息的类的信息。

英文:

Take a look at the documentation for the Map class, where you can find the definition of the size() method:

> Returns the number of key-value mappings in this map. If the map contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

It does not have any parameters and does not throw exceptions.

In general, documentations are your friend. You can easily find information to a class that you want to know more about by googling "java <insert-name-of-class>".

huangapple
  • 本文由 发表于 2020年8月12日 21:34:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/63377680.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定