Detailed description of value type reference type

Source: Internet
Author: User

I. Memory storage values

1. When opening up space in the memory, you must specify the space type.

2. the maximum size of the memory depends on the maximum value of the data type. (Size defined by Microsoft, also known as predefined data types)

3. The space size is different, and the data type is different.

2. Variable notice

1. variables are the space opened up.

2. The variable name is the alias for the space.

3. The variable type is the data type of the space.

4. The value of the variable is the value in the space.

Iii. Difference Between converting string to int, Parse and Convert

Convert conversion is internally called the int. Parse method, except to judge whether the string is null before conversion. If it is null, return 0, int. Parse if it is null, an exception is thrown.

Iv. Value Type and reference type

1. The value type (numeric type, char, bool, enumeration, and structure) directly stores the data in the space of the variable in the stack.

2. variables of the reference type (string, array, and class) are declared in the stack. Real objects are stored in the stack. the variables in the stack store the object address.

3. Assign the value of a variable to another variable. In any case, copy the value in the variable to assign the value. The difference is that, the address is stored in the variables of the reference type, so the address is passed to the same object.

4. Copy the value of the value type. The value of the reference type is the address reference.

 

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.