变量:
1.变量类型(分类):
1.1本地变量
1.2字段
1.3参数
1.4数组元素
2.变量声明:
2.1先声明后使用
2.2指定变量名并关联一个类型
2.3允许编译器为其分配内存空间
3. 初始化:
数据类型:
1.预定义数据类型:
1.1 object类型(System.Object)
1.2 string(System.String)
1.3 dynamic
1.4 简单类型:
1.4.1 非数值类型:bool(System.Boolean),char(System.Char)
1.4.2 数值类型:整形(8bit(byte(System.Byte),sbyte(System.SByte)),16bit(short(System.Int16),ushort(System.UInt16)),32bit(int(System.Int32),uint(System.UInt32)),64bit(long(System.Int64),ulong(System.UInt64))),浮点型(float(System.Single),double(System.Double),decimal(System.Decimal))
2.用户自定义类型:
2.1 class
2.2 struct
2.3 Array
2.4 Enum
2.5 Delegate
2.6 Interface
其中红色表示堆进行存储,其他是栈进行存储。