Dark Horse programmer _java automatic packing and sharing of basic data video learning notes

Source: Internet
Author: User

Boxing: The basic data type is loaded as a Java class (managed?).        Unpacking: Splitting the Java class into a basic data type (unmanaged?). The new version of Java adds the features of the auto-boxing unboxing, which allows the Java base class and basic data types to participate directly in the calculation without conversion.            such as: Integer IOBJ = 3//auto-boxing.        System.out.println (IOBJ + 12);//automatic unpacking. Automatic boxing unpacking is not supported in earlier versions, and the above two statements are incorrect. Knowledge point 1:When boxing, the base numeric type is loaded as a Java class integer object, such as: integer i1 = 13, and if the value is within a byte of -128~127, it will be cached first, and the next time a value is loaded as an integer object        , it will go to the cached object first to find out if there will be a direct fetch it to use will not produce a new object. This design is to enjoy the meta-mode, if there will be a lot of small objects, and the basic properties of these small objects are the same and will not change when used, there is no need to produce a new object every time, create one on the line. Experience:This video can be seen in the study of Java in order to improve the efficiency of such considerations, there will be some unique design, is not imagined, so there is no doubt more hands-on experiment, learning from the practice.

Dark Horse programmer _java automatic packing and sharing of basic data video learning notes

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.