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.