码迷,mamicode.com
首页 > Windows程序 > 详细

C# const与static的理解

时间:2014-11-11 16:02:59      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:style   color   sp   strong   on   bs   ad   ef   size   

C#  const与static的理解

static readonly与 const变量,作用是一样的,无论访问修饰符是不是public,还是其它(private、 protected、internal),变量名称一般为大写,中间以下划线。

 

例如:

public static readonly int Page_Size=  10;

public const int Page_Size10

C# const与static的理解

标签:style   color   sp   strong   on   bs   ad   ef   size   

原文地址:http://www.cnblogs.com/zlp520/p/4089431.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!