Note: This is the first time asking a question about a general curiosity regarding syntax. Because of this I might not be using the correct terminology to describe my question, which may mean its already been answered, and I can't find it because I'm unaware of what terms to use in the search. If that is the case, please post comments so I can edit and refine the question to meet the standard expected by stack overflow. Thank you.
Now the question. I've been using the static keyword a lot recently because I have members I need to access from anywhere without an instance. However its becoming increasingly tedious to declare every member and method static, when the class its self is already static. Since if you declare a class static, it means you can't create an instance of that class (that's my current understanding).
public static class Foo {}
Why does every member have to also be declared static.
public static class Foo
{
public static int X;
public static int Y;
}
I would have thought that since the class, foo in this case, is declared to be static, all its members would automatically be static, and you no longer need to declare each member as static.
Obviously you can't do that, you have to declare every subsequent member static. However this feels counter intuitive and redundant to me.
Whats the reason for this?