C#readonly和const对比

readonly:常量,只能在声明时或构造函数中赋值,与static连用表示静态常量

const:静态常量,只能在声明时赋值

posted @ 2019-07-29 17:07  翻白眼的哈士奇  阅读(234)  评论(0编辑  收藏  举报