As we know we can't used the reserved word, but if you really want used, let's with me.
I have used console application. I make one method and this method Name is @String. if we are directly used string
- public void @string()
- {
- Console.WriteLine("String is a reserved word");
- }
Call here above method.
- static void Main(string[] args)
- {
- Program p = new Program();
- p.@string();
-
- }
Note:- When we are used the Reserved keyword then must be prefix '@' on the Reserved word.
Make another method and name is @name.
- public void @Name()
- {
-
- Console.WriteLine("@name Not a reserved keyword ");
- }
Call here above method
- static void Main(string[] args)
- {
- Program p = new Program();
- p.Name();
-
- }
I hope it's very useful for who's want set the Reserved name set on the Method name.