Reserved words as names or identifiers
Is there any tricky way to use Java reserved words as variable, method, class, interface, package, or enum constant names?
Solution 1:
This is a valid question. Such a thing is possible in other languages. In C#, prefix the identifier with @
(as asked before); in Delphi, prefix with &
. But Java offers no such feature (partly because it doesn't really need to interact with identifiers defined by other languages the way the .Net world does).
Solution 2:
No, there is no way. That's why they're labeled "reserved".
Solution 3:
Most often this issue comes up for "class", in this case it is customary to write "clazz".