C# FAQ: What does at sign identifier mean

Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio


Jump to: navigation, search
CSharp-Online.NET:FAQs
edit

What does at sign (@) identifier mean?

When the at sign (@) occurs before an identifier—the name of a method, property, variable, …—, then the compiler will consider the following string to be an identifier even if the string already has a meaning, e.g. a keyword.

For example, this line will fail to compile:

int new = 1776;   // 'new' is a keyword 

However, this line compiles without error:

int @new = 1776;

Visual C# Worst Practices

Using a keyword or other reserved word as an identifier qualifies as a Worst Practice: don't do it!

See also



Personal tools