摘要:
const 关键字用于修改字段或局部变量的声明。 它指定字段或局部变量的值是常数,不能被修改。 例如: public const double gravitationalConstant = 6.673e-11; 只有 C# 内置类型(System.Object 除外)可以声明为 const。 下表列出了C# 内置类型: boolSystem.BooleanbyteSystem.BytesbyteSystem.SBytecharSystem.ChardecimalSystem.DecimaldoubleSystem.DoublefloatSystem.SingleintSystem.Int32 阅读全文