Java Reference
In-Depth Information
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 filethe
source code. Interpreting those characters, according to the rules of a
given language, is the job of the compiler, or interpreter. Some charac-
ters will represent the names of variables, others will be special keywords
used by the language, still others will be operators or "punctuation" char-
acters used to separate the other elements. All of these textual con-
structs form the lexical elements of the program. These lexical elements
must be identified as keywords, comments, literals, variables, operators,
or whatever else is appropriate for the given language. In this chapter
we look at the basic lexical elements of a Java program, the literal values
that can be expressed and the different kinds of variables that can hold
those values.
 
Search WWH ::




Custom Search