In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "C# basic data type classification". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor to take you to learn the "C# basic data type classification"!
The value type in the C# basic data type stores its data content directly, while the reference type stores the reference of the object. These two types have different meanings to the assignment of variables.
Value types include: simple type, structure type, enumeration type; reference type includes: Object type, class type, interface, representative element, string type, array.
C # basic data type-example of value type
Int m = 0 × int n = m * * m = 1; / / at this time n is still 0, because the data of m and n are stored in different regional reference type examples
Class CFoo {public int n;}
Void Main () {CFoo F1 = new CFoo (); f1.n = 0; CFoo f2 = F1; f1.n = 1; / / at this time f2.n becomes 1, because the contents of f2 and F1 are of the same address} value type
The value types are: byte (1), sbyte (1), short (2), ushort (2), int (4), uint (4), long (8), ulong (8), float (4), double (8), decimal (8), char, bool, enumeration, structure.
The numbers in parentheses above indicate the number of bytes. Byte, ushort, uint, ulong are unsigned types (no negative numbers). By the way, sbyte is signed bytes.
These types are aliases for the .NET Framework type aliases, as indicated by String and string.
C # basic data type-reference type
Reference types are: object type, class type, interface, representative element, string type, array.
Although the string type (string) is a reference type, Microsoft overloaded some of these operators to make it easier for us to design, making it apply as if it were a value type.
At this point, I believe you have a deeper understanding of the "C# basic data type classification". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.