NoReservedWords
Misconception:
Anything that starts with a letter and consists of just letters and digits can be used as an identifier (name of a variable, method, or class).
Incorrect
Every sequence of letters and digits starting with a letter can be used as an identifier
Correct
Some character sequences are reserved for use as keywords and cannot be used as identifiers
CorrectionHere is what's right.
Here is what's right.
Java has some keywords (e.g., new
, return
, if
, int
)
and some literals (true
, false
, and null
)
that are reserved and cannot be used by a programmer as identifiers.
That means it is not possible to use these words to name variables, methods, or classes.
Language
Java
Concepts
Other Languages
Literature References
altadmri37MillionCompilations2015
H: Using keywords as method or variable namesRepository mining study (BlueJ Blackbox)
250000+ students across the world
Java
hristovaIdentifyingCorrectingJava2003
8: Using keywords as method or variable namesQualitative (survey of instructors and students)
Unknown number of undergraduate students, professors, SIGCSE members
Java