Wednesday, August 30, 2006

Java Basic Lexical Elements - Keywords and Reserved Words

Keywords and reserved words cannot be used as identifiers. They are shown here in informal groupings.
  • access modifiers - private, protected, public
  • other modifiers - abstract, final, native, static, synchronized, transient, volatile
  • flow control - break, case, continue, default, do, else, for, if, return, while, switch
  • exceptions - catch, finally, throw, throws, try
  • declarations - class, extends, implements, interface, void, strictfp
  • name space - import, package
  • primitive types - boolean, byte, char, double, float, int, long, short
  • boolean literals - false, true
  • null literal - null
  • reserved but not used - const, goto
  • object related - instanceof, new, this, super
Added in 1.4 and 5.0 are assert and enum. You can read more about assert at http://java.sun.com/j2se/1.4.2/docs/guide/lang/assert.html and enum at http://java.sun.com/j2se/1.5.0/docs/guide/language/enums.html.

No comments: