IX Dude - Instant eXpert Guides - Geek with pocket protector Instant eXpert Guides

Java Reserved Words

Many computer languages have reserved words, key words, or protected words.
These are words that cannot be redefined or declared as new variables, methods or functions.
This article provides information about reserved words in the Java programming language.

Java Reserved Words

1. List of Java Reserved Words
2. Explanation of Reserved Words
3. Classification of Java Reserved Words
4. See also

1. List of Java Reserved Words

abstract, boolean, break, byte, case, catch, char, class, const, continue, default, do, double, else, extends, false, final, finally, float, for, goto, if, implements, import, instanceof, int, interface, long, native, new, null, package, private, protected, public, return, short, static, strictfp, super, switch, synchronized, this, throw, throws, transient, true, try, void, volatile, while

2. Explanation of Reserved Words

To quote the Java Tutorial from java.sun.com, "These words are reserved. You cannot use any of these words as names in your program." However, this explanation may not be totally satisfying to inquiring minds who are always asking why...

We say the Java key-words are reserved words or protected words, or we might use the term immutable or immutability. James Gosling (and the other authors/creators of Java) have protected these words, so that no one can change their attributes, definition, interpretation, perspicuity, specification, or meaning.

A computer language creator has to make choices of setting some basic rules for the language, so that it will have enough logic to perform some useful work. Without some basic rules, language anarchy would be the result, and the language would quickly self destruct and be useful to no one.

Key-words may need to be global in scope, so that all other classes, functions, programs, scripts, methods or modules can use those key-words to perform declaration of data types, or control flow logic.

For example: boolean is the logical data type, and has two values of true and false. The definition for the key-words of boolean, true, and false are protected so that someone could not come along and destroy your program by reversing the meaning of true and false (making true = false, and making false = true).

"Woe unto them that call evil good, and good evil; that put darkness for light, and light for darkness; that put bitter for sweet, and sweet for bitter!" - Isa 5:20

"If all creeds are equally true, then since they are contradictory to one another, they are all equally false, or at least equally uncertain. We are indulging, therefore, in a mere juggling with words." - J. Gresham Machen

3. Classification of Java Reserved Words

The Java reserved words can be classified in several groupings relating to the origin or purpose of the word. Java grammar and syntax provides the language structure and reveals the word classes (or word groups), such as primitive data types, statements, modifiers.

4. See also

  1. Computer Language Reference - Java - Instant Expert Guide
  2. Java Reserved Word Classification - Instant Expert Guide
  3. Java Language Keywords - Java Tutorial (java.sun.com)
  4. Java Keywords - Java Language Specification, Third Edition, January 2005
  5. Java Reserved Words - Appendix A - Learn Java in 21 Days
  6. Reserved Word - WikiPedia article
  7. Reserved Word - BookRags.com - Computer Science Study Guide
  8. Java Reserved Words - Java Tutorials - Appendices




Created with ixDoc - 30-Sep-2005/7:13:17 :: Jump to Index page - Instant Expert Guides

Copyright © 2005, IX Publishing, Inc. - All rights reserved.