I need to design a class where one property name has to be return
, but when I create a property name like return
then I get an error.
Afte
You can't. It is a reserved keyword. That means "you can't". Contrast to "contextual keywords" which usually means "we added this later, so we needed it to work in some pre-existing scenarios".
The moderate answer here is: use @return
.
A better answer here is: rename your property. Perhaps ReturnValue
.
There is also the option of, say, Return
- but you might need to think about case-insensitive languages too.
No way to achieve this because reserved Keywords are predefined, reserved identifiers that have special meanings to the compiler.
it's better you change name of property and use it in you code...something as given in @Marc answer...
You can rename namespaces like this:
using Test = System.Diagnostics;