BLOCKS AND STATEMENTS
Unreachable Statements
14.19
The rationale for this differing treatment is to allow programmers to define
flag variables such as:
static final boolean DEBUG = false;
and then write code such as:
if (DEBUG) { x=3; }
The idea is that it should be possible to change the value of
DEBUG
from
false
to
true
or from
true
to
false
and then compile the code correctly with no other
changes to the program text.
This ability to conditionally compile has a significant impact on, and rela
tionship to, binary compatibility ( 13). If a set of classes that use such a flag
variable are compiled and conditional code is omitted, it does not suffice later to
distribute just a new version of the class or interface that contains the definition of
the flag. A change to the value of a flag is, therefore, not binary compatible with
preexisting binaries ( 13.4.8). (There are other reasons for such incompatibility as
well, such as the use of constants in
case
labels in
switch
statements; see
13.4.8.)
One ought not to be thrown into confusion
By a plain statement of relationship . . .
Robert Frost,
The Generations of Men
(1914)
299
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved