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?
How would I use static public float val()
?
Does it get executed as soon as the class is initialized?
There's no difference. You're free to specify them in either order. However, I find that most developers tend to use public static and not static public.
Well, it is just like the name of a Person =) Calling Tom Mike or Mike Tom, no difference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With