C# 声明变量并赋值的代码演示
class VariableDeclarations { public static void Main() { // Type Identifier Assignment (maximum value) bool aBool; aBool = true; byte aByte; aByte = 255; decimal aDecimal; aDecimal = 0.99m; double aDouble; aDouble = 1.7 * 10308; char aChar; aChar = '\uFFFF'; float aFloat; aFloat = 3.4f * 1038f; int aInt; aInt = 2147483647; long aLong; aLong = 9223372036854775807; object aObject; aObject = new Object(); sbyte aSbyte; aSbyte = 127; uint aUint; aUint = 4294967295; short aShort; aShort = 32767; string aString; aString = "Sample"; ushort aUshort; aUshort = 65535; ulong aUlong; aUlong = 18446744073709551615; } }