- Learn C# in 7 days
- Gaurav Aroraa
- 126字
- 2021-07-08 09:51:25
Data types
These are also famous as compliant value types, simple value types, and basic value types. I call these data types because of their power to define the nature of values. The following table contains all value types:

We can prove the values mentioned in the preceding table with the help of the following code snippet:
//Code is omitted public static void Display() { WriteLine("Table :: Data Types"); var dataTypes = DataTypes(); WriteLine(RepeatIt('\u2500', 100)); WriteLine("{0,-10} {1,-20} {2,-50} {3,-5}", "Type", "CLR Type", "Range", "Default Value"); WriteLine(RepeatIt('\u2500', 100)); foreach (var dataType in dataTypes) WriteLine("{0,-10} {1,-20} {2,-50} {3,-5}", dataType.Type, dataType.CLRType, dataType.Range, dataType.DefaultValue); WriteLine(RepeatIt('\u2500', 100)); } //Code is omitted
In the preceding code, we are displaying maximum and minimum values of data types, which produces the following output:

推薦閱讀