This article describes the following:
Basic concepts of types
Value type in depth
Reference type Depth
Comparison and application of value types and reference types
1. Introduction
Back [eighth: Taste Type---Value type and reference type (upper)-memory rational] release, by the attention of many people, we understand the value type and reference type from the angle of memory, the task left is of course how to apply the different characteristics of the type in the system design, performance optimization and so on to play its role. Therefore, this return is a strong complement to the last, at the same time, in the hope of friends, we try to from the perspective of memory debugging to look at some design analysis, this will help to a thorough and comprehensive understanding of this topic, of course, this is the next point.
It is reasonable to discuss value types and reference types from a memory perspective, and it is boundless to understand value types and reference types from a rule perspective. The purpose of this article is to take this topic from the perspective of the above, to completely integrate the subject, the endless application, or from the capricious practice, so I can only say that the application of an angle to explain the point of view, but certainly impossible to achieve the overall situation. Therefore, we have discussed the application area of value type and reference type from the following angles.
2. General rules and comparisons
Universal has rules:
The string type is a special reference type, and it inherits from System.Object is definitely a reference type, but in the application performance and highlight the characteristics of the value type, then what is the reason? For example, the following paragraph is executed: