Java hashmap syntax changes after 1.5.

Source: Internet
Author: User

First of all, we don't need to talk about the basics of hashmap. Here we will talk about its changes after 1.5. When we were doing Java, we would say hashmap was written like this: map xxx = new hashmap (); a yellow alarm may appear. This is the syntax of later versions of Java, called generic writing. After this definition, when a hashmap is followed by a key-value pair, the string type must be used as the key, and the float type must be used as the value.

The advantage is to clearly tell JVM how to allocate memory space to it, which can improve JVM efficiency and optimize memory storage.

 

 

 

In fact, no matter how it is written, it is not easy to keep the yellow warning. The level is limited!

Related Article

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.