Which of the following are Java keywords?
1) NULL
2) new
3) instanceOf
4) wend
Answer:
2) new
The option NULL (note the upper case letter) is definitely not a keyword. There is some discussion as to if null is a keyword but for the purpose of the exam you should probably assume it is a keyword.
The option instanceOf is a bit of a misleading option that would probably not occur on the exam. The real keyword is instanceof (note that the of has no capital letter O). I had the incorrect version in an earlier version of this tutorial as it looks more likely to my eyes. The instanceof keyword looks like a method, but it is actually an operator.
The option wend is probably valid in some other language to indicate the end of a while loop, but Java has no such keyword.
No comments:
Post a Comment