C#公共静态VS静态公共 - 是有区别吗? [英] C# public static vs static public - is there a difference?

查看:102
本文介绍了C#公共静态VS静态公共 - 是有区别吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 sealed class PI
 {
   public static float number;
   static PI()
   {    number = 3.141592653F; }
   static public float val()
   {    return number;      }
 }

什么是公共静态和静态公网之间的区别?他们可以以任何顺序使用?

What's the difference between public static and static public? Can they be used in any order?

第二个问题,我将如何使用这个静态公众持股量VAL()

Second question, how would I use this static public float val()?

是否得到尽快类初始化执行?

Does it get executed as soon as the class is initialized?

推荐答案

嗯,这就像一个人的名字=) 呼叫汤姆·麦克或麦克·汤姆,没有什么区别。

Well, it is just like the name of a Person =) Calling Tom Mike or Mike Tom, no difference.

这篇关于C#公共静态VS静态公共 - 是有区别吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆