posted 23 years ago
Mughal's mcok exam has the following erratum:
QUESTION:
Which are valid identifiers:
(a) class
(b) $value$
(c)zer@
(d)angstroem
(e)2much
It specifies the correct answer as being (a), (b) and (d).
However class is not an identifier as per $3.8 of the JLS:
"An identifier cannot have the same spelling (Unicode character sequence) as a keyword, boolean literal, or the null literal."
class being a keyword and given the above quote from JLS it follows that class in not an identifier. Hence the answer claimed to be correct actually is not, the correct answer being (b) and (d).
Panagiotis.