java--container (auto-boxing/unboxing)

Source: Internet
Author: User
Tags unpack

"Pack/Unpack"

when you need to add a value to a map, it is inconvenient to have the new object come out and the output to be forced type conversion. The use of the map interface in JDK1.5 provides a new mechanism.
Automatic packing/unpack at the right time (only after JDK1.5)<1> automatically converts the underlying type to an object<2> convert objects to the underlying type automatically "Program Analysis" Note: This can be written after JDK1.5:M1.put ("One", 1);//Thrown in is still an object, but internally converted to int type       M2.containvalue (1); int i = (Integer) m1.get ();//coercion type conversion integer here can not be ignored    

java--container (auto-boxing/unboxing)

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.