We take pride in your success. We let our positivity drive us, day in and out. Talk to us at Mindfire to know us more.

Software Technology Tips

 
In C# We cannot use a Keywords as an Identifier since the former is predefined and has special meaning to the compiler whereas an identifier is user-defined. However, we can use a keyword as user-defined identifier by appending "@" (at) or "_" (underscore) characters.
 
For example: if we write

Class class           //Conflict error

It throws an error. Here we can place @ or _(underscore) before class to use it as class name.

Class @class / _class       //No error

 

In the same way we can also write as

int @class;

@class = 5;

Like this we can use @class or _class as identifier.


Related Tags:

C#, Keyword,Identifier

Author: Sibabrata Dash

top

C#

Let us Connect!

privacy

copyright (c) Mindfire Solutions 2007-2012. Login