Search code examples
c#.netstaticstandardsaccess-modifiers

"public static" vs "static public" - is there a difference?


sealed class PI
{
  public static float number;
  static PI()
  { number = 3.141592653F; }
  static public float val()
  { return number; }
}
  1. What's the difference between public static and static public? Can they be used in any order?

  2. How would I use static public float val()?

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


Solution

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