|
|
Language Fundamentals - Keywords
| Keyword type |
Keywords |
| Primitive types |
boolean, byte, char, double, float, int, long, short |
| Access modifiers |
public, private, protected |
| Special modifiers |
abstract, final, native, static, strictfp, synchronized, transient, volatile
|
| Control flow |
if, else, do, while, switch, case, default, for, break, continue
|
| OOP specific |
class, extends, implements, import, instanceof, interface, new, package, super, this |
| Exception handling |
catch, finally, try, throw, throws |
| Method specific |
return, void |
| Unused * |
const, goto |
| * Note |
- const and goto are not used in Java however they are reserved as keywords.
- true and false are Boolean Literals; null is a null Literal. They cannot be used as identifiers.
|
Tips
- Java keywords are always lowercase; you can immeadiately eliminate any capitalized words appearing in a question listing possible keywords
Traps
- main listed as a possible keyword
- capitalized words listed as possible keywords; particularly wrapper classes Integer, Boolean, etc
- C/C++ keywords listed as possible Java keywords
|