|
|
Java2 Certification
|
Identify all Java programming language keywords.
Note on this objective: You may like to approach this objective on the basis of learning the less frequently used key words and ensuring you do not carry over any "false friends" from other languages you may know, particularly C/C++. The exam places significant emphasis on recognising keywords
You will come to recognise most of the Java keywords through using the language, but there are rarely used exceptions, and reserved words that might come up in the exam.
Examples of the more rarely used words (certainly for a beginner anyway) are
abstract | boolean | break | byte | case | catch |
char | class | const * |
continue | default | do |
double | else | extends | final | finally | float |
for | goto * |
if | implements | import | instanceof |
int | interface | long | native | new | null |
package | private | protected | public | return | short |
static | super | switch | synchronized | this | throw |
throws | transient | try | void | volatile | while |
The words with asterisks are reserved and not currently used. Note that all of the keywords are in lowercase, thus for is a keyword but FOR is not. There is some debate as to if null is a keyword but I suggest that for the purposes of the exam you assume it is.
Which of the following are Java key words?
1) double
2) Switch
3) then
4) instanceof
Which of the following are not Java keywords?
1)volatile
2)sizeOf
3)goto
4)try
1) double
4) instanceof
Note the upper case S on switch means it is not a keyword and the word then is
part of Visual Basic but not Java
2) sizeOf
This is a keyword in C/C++ for determining the size of a primitive for a
particular platform. Because primitives have the same size on all platforms in
Java this keyword is not needed.
This topic is covered in the Sun Tutorial at Michael Thomas |
Last updated
28 Dec 1999
copyright © Marcus Green 1999