Is there a method that allows you to use a keyword as a resource name in Java similar to the method used in C# of adding @ to the start of the word?
I found some posts asking this a few years ago and it wasn't possible then. Was it possibly added though in Java 7 or may be added in Java 8?
Reasons for doing this are very scarce. For me though I've encountered it when deserializing large json objects that use the keywords as variable names. A particular json object I'm working with uses throw. In C# I'd just add "string @throw" into my class that I use to deserialize the object. The only methods I can find to do this in java would require a streaming deserialization which would be a major pain, or string parsing with Regular Expressions both of which seem to be a lot of work for what could otherwise be a super simple task.
No, this is not possible in Java. The names of variables
in Java cannot coincide with any keywords or reserved words.