Samuel Carrijo
Samuel Carrijo

Reputation: 17939

Are there equivalents to "this" for static variables in c#

I was wondering if I can make my code clearer by indicating one variable is a static class variable. If it wasn't static I could use this.variableName, and everyone would look at it and immediately know that.

I know I could adopt a naming convention like s_variableName, but that seems a little odd to me and increases the learning curve of the code.

Is there an equivalent of "this" for static variables?

Upvotes: 6

Views: 323

Answers (1)

Mehrdad Afshari
Mehrdad Afshari

Reputation: 422132

Qualify it with the type name:

TypeName.staticVariableName

Upvotes: 26

Related Questions