Chapter 7. Tokens, Values, and Variables


There's nothing remarkable about it. All one has to do is hit the right keys at the right time and the instrument plays itself.

 --Johann Sebastian Bach

A program starts as a sequence of characters contained in a file—the source code. Interpreting those characters, according to the rules of a given language, is the job of the compiler, or interpreter. Some characters will represent the names of variables, others will be special keywords used by the language, still others will be operators or “punctuation” characters used to separate the other elements. All of these textual constructs form the lexical elements of the program. These lexical elements must be identified as keywords, comments, literals, variables, ...

Get THE Java™ Programming Language, Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.