There have been times when there was a need to use the C# keywords as names of the variable, but we were not able to do so as it is not allowed and gives a Compile Time error.
For e.g. the below code, will give you a compile time error stating: "Cannot implicitly convert type 'System.Random' to 'string'"
- Random string = new Random();
Although, there is a way in which we can use this name without any error. Please see the below code:
- Random @string = new Random();
The same thing can be used for other keywords as well.
Please feel free to post your inputs as comments.
Thanks
Vipul

Sonu ChaudharyPosted Feb 25, 2016, 7:15 AM
nice article
Vivek BansodPosted Jan 25, 2016, 8:42 AM
That's interesting but what could be the scenario where one will use keywords as variable? Just trying to understand purpose of this feature.
Vlad LandcovschiPosted Jan 15, 2016, 9:50 AM
Interesting
Dhanik SahniPosted Dec 29, 2015, 2:36 AM
interesting
Ricky NguyenPosted Sep 25, 2015, 5:11 AM
Nice ^^
pooja guptaPosted Jul 4, 2015, 2:40 PM
This is interesting. Thanks