Java Learning Diary ————— Map interface

Source: Internet
Author: User

Map and collection exist in parallel. To hold data that has a mapping relationship: Key-value
Both the key and value in the MAP can be data of any reference type
The key in the map is stored with set, which does not allow repetition, that is, the class corresponding to the same map object, the Hashcode () and the Equals () method must be overridden.
The common string class acts as a "key" to the map.
There is a one-way relationship between key and value, that is, a unique, deterministic value can always be found through the specified key


Map Common methods :

Add, delete operations:
Object put (object Key,object value)
Object remove (Object key)
void Putall (Map t)
void Clear ()

Ways to manipulate Meta view:
Set KeySet ()
Collection VALUES ()
Set EntrySet ()

Element query operation:
Object get (Object key)
Boolean ContainsKey (Object key)
Boolean Containsvalue (Object value)
int size ()
Boolean IsEmpty ()
Boolean equals (Object obj)

Java Learning Diary ————— Map 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: 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.