Java Map.entry Interface

Source: Internet
Author: User

Map.entry interface, you can work with a map entry.

The EntrySet () method declared in the map interface returns a set containing the mapping entries. Each group element is a Map.entry object.

The following table summarizes the methods that the interface declares:

SN Method and Description
1 boolean equals (Object obj)
If obj is a map.entry returns true, its key and value are equal to the calling object.
2 Object GetKey ()
Returns the key for this mapping entry.
3 Object GetValue ()
Returns the value of this mapping entry.
4 int Hashcode ()
Returns the hash code for this mapping entry.
5 Object SetValue (Object v)
The collection of this mapping entry v . If v is an incorrect type, the mapping throws a ClassCastException exception value. If V is null and the map does not allow the null key, the nullyiibaierexception exception is thrown. A unsupportedoperationexception is thrown if the mapping cannot be changed.
Example:

The following is an example of how map.entry is used:

Daisy 99.22Qadir: -19.08zara:3434.34ayan:1378.0mahnaz:123.22zara ' s new balance:4434.34


Java Map.entry Interface

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.