Originally posted by Aruna Agrawal:
Which of the following are not legal Java identifiers?
Select 1 correct option.
a goto
Although not used, it's a reserved word.
b unsigned
It's not a reserved or keyword.
c String
Yes, it is valid. This is a valid statement: String String = "String";
d _xyz
Can start with _ or $
e $_abc
Can have _ or $.
Ans a.
why not b??
because
unsigned is not reserved or keyword ( as the explanation is already given) . You can declare a variable something like this
int unsigned = 10; //here unsigned is a variable
If you try to use
goto in your java code you will get compiler error.
unsigned is keyword in C++ I believe
Cheers,<br />Jay<br /> <br />(SCJP 1.4)<br />Heights of great men were not achieved in one day, they were toiling day and night while their companions slept.