Homework after class

Source: Internet
Author: User

Difference between a value type and a reference type

As an example,

such as a1=18, this time in memory is 18, when the A1 pay A2, they both apply the same memory space, 18 will be saved as A1 value, when the A2 to 20 is, should be A1 and A2 reference is the same value, So A1 also becomes 20, which is the reference type

   A value type is a value that is stored A1 for A2 in a new space when the A1 is paid to A2 . When the A2 is changed  into a A2 in the space to save, and A1 it is not related A1 and A2 The values do not conflict.
The reference type is the bank when the passbook is taken, and the value type is that the cash can be taken directly.

Homework after class

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.