Il second school Summary

Source: Internet
Author: User

When we declare a value type variable, we create a data structure. when we box this variable, an object (a class instance) is created whose data part is an exact bit copy of the data structure. then we can deal with this instance the same way we wowould deal with an ordinary object-for example, we cocould use it in a call to a method, which takes an object reference as
Parameter. it is important to understand that the "original" instance of a value type does not go anywhere after it has been boxed. its copy does. and what happens to this copy is not reflected back to the original Instance of the value type. this effect is known as a problem of mutability of the boxed value types. it is up to the author of the Code to propagate possible
Changes inflicted upon the boxed instance of the value type back to the original Instance.

 

When a value type variable is declared, a data structure is created. When this variable is packed, an object (a class reference) is created, and its data part is the accurate bit copy of the data structure ). Then, you can process the instance like a common object. For example, you can use the call method of the instance to receive an object reference as a parameter. The "original" instance of the value type after the packing operation cannot be moved at will. It is very important to understand this. Its copies can be moved. Its copy will not affect the "original" instance of the value type in turn no matter what changes have taken place. This effect is called the instability of the boxed type. It is necessary for the author of the Code to spread possible changes that will affect the boxed instances of the value type. Changes caused by a value-Type Boxed instance will not in turn affect the "original" instance of the value type.

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.