C# 中聲明常量的方法的代碼


把內容過程經常用的內容珍藏起來,下面的資料是關於C# 中聲明常量的方法的內容。
class ConstantDeclarations
{
public static void Main()
{
const bool aBool = true;
const byte aByte = 255;
const decimal aDecimal = 0.99m;
const char aChar = 'uFFFF';
const int aInt = 2147483647;
const long aLong = 9223372036854775807;
const object aObject = null;
const sbyte aSbyte = 127;
const uint aUint = 4294967295;
const short aShort = 32767;
const string aString = "Sample";
const ushort aUshort = 65535;
const ulong aUlong = 18446744073709551615;
}
}




 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM