Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

What does the @ symbol before a variable name mean in C#?

I understand that the @ symbol can be used before a string literal to change how the compiler parses the string. But what does it mean when a variable name is prefixed with the @ symbol?
by

1 Answer

akshay1995
The @ symbol allows you to use reserved word. For example:

int @class = 15;

The above works, when the below wouldn't:

int class = 15;

Login / Signup to Answer the Question.