Spec-Zone .ru
спецификации, руководства, описания, API
Contents | Prev | Next | Index Java Language Specification
Third Edition


A

abrupt completion
See completion, abrupt
abstract modifier
See also declarations; modifiers
classes
anonymous are never, 335
binary compatibility considerations, 257
declaration of, 135
definition and characteristics, 135
direct superinterface relationship to, 142
methods
binary compatibility considerations, 268
classes, 170
declaration examples, 167, 205
interfaces, 205
overloading, 207, 208
overriding, 207
semicolon as body of, 176
and super method invocation, 355
access
See also scope
accessibility
determining, 105
term definition, 104
array, 211
expression evaluation order, 365
constructor, binary compatibility considerations, 261
of fields, expression evaluation, 341
inheritance of class members, example
default, 149
private, 151
protected, 150
public, 150
interface member names, 202
access (continued)
method, binary compatibility considerations, 267
non-public class instances, through public superclasses and superinterfaces, 151
overridden methods, using super keyword, 178
qualified
See also field access expressions; method invocation expressions
term definition, 104
access control
See also security
classes, example, 107
constructors
default, example, 108
private, example, 111
protected, example, 110
public, example, 109
fields
default, example, 108
private, example, 111
protected, example, 110
public, example, 109
methods
default, example, 108
private, example, 111
protected, example, 110
public, example, 109
package names, limited significance of, 120
protected, details of, 105
and qualified names, 104
term definition, 104
accessible
default for top-level types, 129
package, term definition, 105
accessible (continued)
single-type import must name a type that is, 126
type or package may not be named by type-import-on-demand if not, 127
types, members and constructors, term definition, 104
actions
See also methods
main memory subsystem
lock, 431
read, 431
unlock, 431
write, 431
prescient store, with threads, 438
thread
assign, 431
load, 431
lock, 431
store, 431
unlock, 431
use, 431
threads, constraints on relationships among, 433
algebraic identities
See also expressions; mathematical functions
limits on use of, 325
alphabet
See also syntax
components
See characters
data types
See primitive types
term definition, 9
ambiguity
See also names, ambiguous; scope
avoiding, in fields with multiple inheritance, 166
avoiding, in types with multiple inheritance, 188, 208
anonymous class, 135
See also inner class
and checked exceptions in initializers, 221
definite assignment before, 426
determining immediately enclosing instance when instantiating, 332
example(s), 161, 194
anonymous class (continued)
exceptions in instance initializer, 189
in an explicit constructor invocation, 194
interaction with shadowing of parameter names, 168
in an interface variable initializer, 204
protected accessibility of superclass constructor, 106
supertypes classified as type names, 95
term definition, 330
argument
See also parameters
lists, evaluation order, 326
values, method invocation conversion context, 71
arithmetic
See also floating point; integers; numbers; operators; primitive types
integer division, ArithmeticException, 321
operators, numeric promotion, specification, 77
arrays
See also classes; data structures
(chapter), 209
access, 211
expression evaluation order, 364
assignment, expression evaluation order, 394
character, distinguished from strings, 215
Class
objects, 215
obtaining, example, 53
Cloneable interface implemented by, 214
components
See also variables
assignment, run-time testing, 216, 320, 395, 400
default values, 51
initialization, 213
as a kind of variable, 48
type declaration, 213
creation, 42, 211
expression evaluation, 338
order, 338
out-of-memory detection, example, 340
example, 210
arrays (continued)
exceptions, ArrayStoreException, 217
indexing of, 211
initialization, 211, 212
members, 92, 213
names, fully qualified, 111
Object as superclass of, 215
origin, 211
variables
declaration, 210
initialization, 210
ASCII characters
See also characters; Unicode character set
Unicode character set relationship to, 14
assignment
See also fields; initialization
array, expression evaluation order, 394, 399
assignable to, term definition, 66
compatible, term definition, 66
compound
evaluation order, 323
operators, evaluation, 398
conversion context, specification, 56, 66
definite, (chapter), 407
expressions
boolean, definite assignment, 412
definite assignment, 412
as statements, 287
operation, to change value of primitive value, 33
simple operators, evaluation, 393
B

backslash (\)
escape sequence, 28
Unicode escape use, 15
backspace
escape sequence, 29
base
See also numbers
permitted in integer literals, 21
Beta, 3, 7
biblical quotations
I Corinthians 14:40, 322
John 3:30, 369
Matthew 6:29, 209
bibliographic references
Dynamic Class Loading in the Java Virtual Machine, 232
Polling Efficiently on Stock Hardware, 224
Release-to-Release Binary Compatibility in SOM, 251
binary
compatibility
See also code generation; compile-time errors; exceptions
(chapter), 251
changes that do not break, 252
compatible with, term definition, 256
contrasted with source compatibility, 257
file format, required properties, 253
name
See name, binary
numeric promotion, specification, 79
representation, verification of classesand interfaces, 232
blank final
field
class variable must be assigned by static initializer, 156
definite [un]assignment of, 418
definite assignment of, 407
instance variable must be assigned by every constructor, 156
notation for definite assignment, 412
restrictions in an inner class, 141
variable
definite unassignment of, 407
notation for definite unassignment, 412
blocks
See also control flow; statements
(chapter), 275
definite assignment, 418
enclosing, 141
in scope of exception handler parameters, 86, 306
in scope of local class, 86, 278
blocks (continued)
in scope of local variable, 85, 280
specification and execution of, 277
Bobrow, Daniel G., 6
body
See also declarations
class
declarations in, 147
term definition, 147
constructor, 192
binary compatibility considerations, 270
interface, declarations, 202
method, 176
binary compatibility considerations, 270
boolean
See also numbers
literals, term definition and specification, 25
operators, 40
types and values, term definition and specification, 40
bootstrap loader
See class loaders, bootstrap
brackets ([])
array type declaration, 41, 209, 280
break statement
See also control flow
definite assignment, 423
as reason for abrupt completion, 276
specification, 297
Burke, Edmund, 275
Burroughs, Edgar Rice, 301
Burton, Robert, xxiii
but not phrase
grammar notation use, 12
byte type
See also integral types; numbers; primitive types
value range, 33
C

C, 1, 2, 7
C++, 1, 2, 6
Caesar, Julius, 374
caller
of a statement, term definition, 222
carriage return (CR)
escape sequence, 29
handling in a
character literal, 26
string literal, 27
as a line terminator, not input character, 16
casting
See also conversion
boolean, 41
conversion context, 56
specification, 72
floating-point types, 38
integral types, 34
reference types, 73
run-time testing, 320
to void, not permitted, 287
catch clause, 303
See also control flow; try statement
exception handling role of, 219
exception idiom defined with, 226
scope of parameters, 86, 306
Cervantes, Migel de, 72
characters
See also numbers; primitive types; strings
array of, distinguished from strings, 215
char type, 31
See also integral types; numbers; primitive types
value range, 33
line terminators, 27
literals
escape sequences for, 28
term definition and specification, 26
Unicode character set
composite, contrasted with the Unicode decomposed characters, 20
handling in package names, 122
lexical grammar use as terminal symbols, 9
relationship to ASCII, 14
Chase, Lincoln, 118
checking
See also exceptions, checked; throw
for exception handlers, at compile-time, 221
Christie, Agatha, 276, 288, 347
circular declaration
of a class
compile-time error caused by, 144
circular declaration (continued)
of a class (continued)
example involving a local class, 278
link-time error caused by, 144
of an interface, compile-time error caused by, 201
of types, in different compilation units, legality of, 123
class literal, 95
class or interface name in a, 82
is a primary expression, 327
term definition, 328
class loaders
bootstrap, 248
and class unloading, 248
class(es)
See also fields; inheritance; interfaces; methods; packages; subclasses; superclasses; superinterfaces
(chapter), 135
abstract, 137
as array component types, 210
binary compatibility considerations, 257
overriding abstract methods in, 170
uses, 139
accessibility, 105
anonymous
See anonymous class
binary compatibility considerations, 257
binary representation
binary file format requirements, 256
verification of, 230
body
declarations, binary compatibility considerations, 259
term definition and declarations in, 147
.class suffix, as name for compiled files, 122
Class objects, associated with arrays, 215
constructors, binary compatibility considerations, 267
declarations, 136
specifying direct superclasses in, 142
specifying direct superinterfaces in, 144
term definition, 136
as declared entity, 81
exceptions
ClassCastException, 75
class(es) (continued)
exceptions (continued)
Error, 221, 226
Exception, 226
RuntimeException, 222, 226
Throwable, 219, 221, 226
final
binary compatibility considerations, 258
declaration of, 139
finalization of, 258
FP-strict, 319
inaccessible, accessing members of, 151 example, 151
initialization, 236
detailed procedure, 239
example, 231
instances
See instance(s)
instantiation, preventing, 190
linking
initialization, 227, 230, 239
preparation, 227, 234, 239
process description, 234
resolution, 230
at virtual machine startup, 230
loading, 232
errors
ClassCircularityError, 233
ClassFormatError, 233
NoClassDefFoundError, 233
process description, 233
at virtual machine startup, 230
local
See local class
member
See member class
members, 90
declarations, 147
binary compatibility considerations, 259
methods
class, 171
interface, 205
non-static, 172
static, 171
named, 135
and checked exceptions in initializers, 221
class(es) (continued)
names, fully qualified, 111
naming conventions, 114
nested
See nested classes
non-public, in example of qualified names and access control, 107
preparation, 234
at virtual machine startup, 230
preventing instantiation of, 139
public
access control in, 105
binary compatibility considerations, 258
in example of qualified names and access control, 107
references to, binary file format requirements, 253
resolution
exceptions
IllegalAccessError, 235
IncompatibleClassChangeError, 235
InstantiationError, 235
NoSuchFieldError, 236
NoSuchMethodError, 236
process description, 235
at virtual machine startup, 230
scope of, 85, 125
in scope of an imported type, 85, 125
static initializers, 189
binary compatibility considerations, 271
that depend on themselves
See circular declaration, of a class
that directly depend on a reference type
See circular declaration, of a class
top-level
See top-level class
type declarations, as members of packages, 129
unloading of, 248
variables
default values, 51
specification, 48, 155
verification, at virtual machine startup, 230
classification
reclassification of contextually ambiguous names, 96
classification (continued)
syntactic, of a name according to context, 94
code generation
See also binary, compatibility; compile-time errors; exceptions; optimization
asynchronous exceptions, implications for, 224
initialization, implications for, 241
symbolic reference resolution, implications of, 235
comments
term definition and specification, 18
Common Lisp, 6
compatibility
See binary, compatibility
compilation
See also compile-time errors; exceptions; virtual machine
CompilationUnit goal symbol, syntactic grammar use, 10
conditional
binary compatibility considerations, 265
if statement reachability handling to support, 314
exception handlers checked for during, 221
unit
components, package declarations, 124
and default accessibility of top-level types, 129
implicitly starts with import java.lang.*, 128
importing types into, 125
and meaning of a simple type name, 99
and name of top-level type, 129
overview, 119
and package membership, 89, 119
and package observability, 125
and scope of an import declaration, 85, 125
term definition and characteristics, 123
compile-time constant
See constants
compile-time errors
See binary, compatibility; errors; exceptions
completion, 276
See also control flow, exceptions
abrupt
break statement, 297
continue statement, 299
disallowed for static initializers, 189
during expression evaluation, 320
for statement, 295
labeled statements, 286
reasons for, 276, 321
return statement, 301
synchronized statement, 304
throw statement, 302
try statement, 305
try-catch statement, 307
try-catch-finally statement, 308
normal
during expression evaluation, 320
during statement execution, 276
required for instance initializers, 189
required for static initializers, 189
component(s)
See also arrays, components
type, arrays, 210
conflicts
name
See also hiding; obscuring; scope; shadowing
avoiding through use of syntactic context, 94
Conner, Michael, 251
constants
See also fields; class; final; fields, interface; literals
are always FP-strict, 319
characteristics and binary compatibility considerations, 264
compile-time narrowing of
by assignment conversion, implications, 66
not permitted by method invocation conversion, 71
expressions, 405
field, term specification, 264
may be declared in inner class, 140
named
See fields; class; final
constructors
See also class(es); execution; initialization; interfaces; methods
access, 105
binary compatibility considerations, 261
control
default, example, 108
private, example, 111
protected, example, 110
public, example, 109
hidden fields, this keyword use for, 283
accessibility, 105
allow field access through super, 344
anonymous
term definition, 335
anonymous class
cannot have explicitly declared, 335
has anonymous constructor, 335
are not members, 148
body, 192
binary compatibility considerations, 270
as components of a class body, 147
declarations, 190
binary compatibility considerations, 267
default, 195
definite assignment and unassignment within, 427
definite assignment of variables before, 418
deleting, binary compatibility considerations, 267
determining arguments to, 334
each must declare exceptions from instance initializers, 188
explicit invocation statements, 193
explicit invocations, 105
FP-strict, 319
invocation, during instance creation, 242
modifiers, 191
must assign all blank final instance variables, 156
must assign blank final fields, 156
names of, 83, 190
as non-members of a class, 90
overloading, 195
binary compatibility considerations, 270
parameters, 191
See also arguments
constructors (continued)
parameters (continued)
assignment during instance creation, 242
binary compatibility considerations, 267
definite [un]assignment of, 425
must not be assigned if final, 168
shadowing, 86, 168
specification, 51, 191
private, preventing instantiation with, 139, 197
protected, accessibility of, 105, 106
signature, 191
binary file format requirements, 255
throws clause, binary compatibility considerations, 270
and unreachable statements, 310
when reachable, 311
context(s)
See also inheritance; scope
conversion, 56
assignment, specification, 66
casting, specification, 72
method invocation, specification, 71
reclassification of contextually ambiguous names, 96
role in determining the meaning of a name, 81, 93
static
See static context
syntactic classification of a name according to, 94
context-free grammars
See grammars, context-free
continue statement
See also control flow
definite assignment, 423
as reason for abrupt completion, 276
specification, 299
contract
See also binary, compatibility
term definition, 256
control flow
See also completion; definite assignment; exceptions; expressions; statements; statements, unreachable; threads
boolean expressions use for, 40
control flow (continued)
break statement, specification, 297
continue statement, specification, 299
deadlock avoidance, multiple lock use for, 305
do statement, specification, 293
for statement, specification, 295
if statement, dangling else handling, 284
if-then statement, specification, 288
if-then-else statement, specification, 288
local variable declaration and switch statement, 49
return statement, specification, 301
switch statement, specification, 288
synchronized statement, specification, 304
throw statement, specification, 302
try statement, specification, 305
try-catch statement, specification, 307
try-catch-finally statement, specification, 308
while statement, specification, 292
conventions
naming, 113
impact on obscuring of names, 89
conversion
See also casting; numbers; promotion
(chapter), 55
casting, 72
contexts
assignment, specification, 66
casting, specification, 72
method invocation, specification, 71
forbidden, specification, 64
identity
in assignment conversion context, 66
in casting conversion context, 72
in method invocation conversion context, 71
specification, 58
kinds of, 58
in method invocations, 71
narrowing
primitive
in assignment conversion context, 66
in casting conversion context, 72
conversion (continued)
narrowing (continued)
primitive (continued)
not allowed in method invocation conversion context, reasons for, 71
reference, in casting conversion context, 72
reference
narrowing, 63
widening, 62
string, 72
specification, 64
term definition, 55
value set
in assignment conversion, 66
in binary numeric promotion, 79
in casting conversion, 72
in method invocation conversion, 71
in overview, 56
term definition, 65
in unary numeric promotion, 78
widening
primitive
in assignment conversion context, 66
in binary numeric promotion context, 79
in casting conversion context, 72
in method invocation conversion context, 71
in unary numeric promotion context, 78
reference, 62
in assignment conversion context, 66
in casting conversion context, 72
in method invocation conversion context, 71
term specification, 62
creation
See also declaration; initialization
array, 42, 211
expression evaluation
example, 339
order, 338
out-of-memory detection, example, 340
instance, 42
expression evaluation order, 334
expressions as statements, 286
creation (continued)
instance (continued)
invocation of initializers for instance variables during, 244
method dispatching during, 244
specification and procedure, 241
object, 42
threads, 445
Creatore, Luigi, 30
D

Danforth, Scott, 251
dangling else
See also control flow
handling of, 284
data
See also constants; fields; variables
structures
See arrays; classes; interfaces; primitive types; vectors
types
See types
values
See values
database
storing packages in, 119
deadlock
avoidance, multiple lock use for, 305
decimal
See also numbers
base, permitted in integer literals, 21
numerals, specification, 21
declarations
See also body; execution; methods; parameters; statements
class
(chapter), 135
body, 147
member, 147
term definition and specification, 135
constructor, 190
field(s), 153
constants in interfaces, 203
examples of, 162
interface, examples, 204
declarations (continued)
identifiers in, kept separate from those in labeled statements, 84
import
example, 128
single-type, 126
term definition, 125
type-import-on-demand, 127
instance variable, 48
interface, 200
(chapter), 199
body, 202
members, 202
local variable, definite assignment, 419
method(s), 167
examples of, 180
interface, abstract, 205
modifiers
See
abstract modifier; final modifier; native modifier; private modifier; protected modifier; public modifier; static modifier; synchronized modifier; transient modifier; volatile modifier
overriding, example, 180
package, in compilation units, 123
scope of, 85
shadowed, term definition, 86
shadowing, 86
subclass, 142
superclass, 142
superinterface, 144, 201
term definition, 82
type
as members of packages, 129
need not appear before use of the type, 86
usage in, 46
variable
array, 210
local, 279
execution of, 283
declarator
in scope of local variable, 85, 86, 280, 296
definite assignment
See also exceptions; execution; scope
definite assignment (continued)
(chapter), 407
and anonymous classes, 426
of blank final class variables, 156
of instance variables, 156
and local classes, 418
of member types, 426
and parameters, 425
and qualified class instance creation, 417
requirement for locals and parameters before an inner class, 141
and static initializers, 426
of variables with respect to nested classes, 418
definite unassignment, 407
See also definite assignment
hypothetical analysis of, 412
and local classes, 418
and qualified class instance creation, 417
and static initializers, 426
DeMichiel, Linda G., 6
denormalized
IEEE 754 standard, support required for, 38
digits
Java, term definition, 19
directly depends
class, term definition, 144
division
See also arithmetic; numbers
integer divide by zero, indicated by ArithmeticException, 34, 375
do statement
See also control flow
definite assignment, 421
specification, 293
double quote
escape sequence, 29
in string literals, 27
double type
floating-point literal specification, 24
Duff's device, 289
Dylan, 6
E

Eco, Umberto, 118
Eisenhower, Dwight D., 388
element type
arrays, term definition, 210
Ellis, Margaret A., 6
Ellison, Shirley, 118
entity
declared, list of, 82
Epictetus, 203
errors
class variable initializers may not refer to instance variables, 159
Error class, unchecked exceptions as subclass of, 176
linking, 227, 234
resolution, 235
verification, 234
loading, 227, 233
reasons for, 220
semantic, exceptions as mechanism for signaling, 219
types, run-time, 320
unchecked, reasons for, 221
virtual machine, 227
escapes
sequences, for character and string literals, 28
Unicode, specification, 14
evaluation
See also execution; initialization; scope
evaluated, term definition, 317
expressions
additive operators, 377
additive operators for numeric types, 381
array access, 364
array assignment, 393
array creation, 338
assignment operators, 392
bitwise binary operators, 388
bitwise complement, 371
boolean equality operators, 388
boolean logical operators, 389
cast, 372
compound assignment operators, 398
conditional operator, 391
conditional-and operator, 390
conditional-or operators, 390
division, 374
evaluation (continued)
expressions (continued)
equality operators, 386
field access, 341
instance creation, 334
integer bitwise operators, 389
logical binary operators, 388
logical complement, 371
method invocation, 345
method invocation, order of, 356
multiplication, 373
multiplicative operators, 373
numeric comparison, 384
numeric equality operators, 387
parenthesized, 330
postfix, 368
pre-decrement, 369
pre-increment, 369
primary, 327
reference equality operators, 388
relational operators, 384
remainder, 376
shift operators, 383
simple assignment operator, 393
string concatenation, 378
superclass access, 344
type comparison, 385
unary minus, 370
unary operators, 368
unary plus, 370
literals, 328
order
arguments left-to-right, 326
binary operators, 322
compound assignment, 323
left-hand operand first, 322
left-to-right, 322
operands evaluated before operations, 324
parentheses and precedence respected, 325
result of, term definition, 317
events
See also methods
execution order of, constraints on relationships among, 433
evolution
See also binary, compatibility; reuse
evolution (continued)
of classes, binary compatibility considerations, 257
of interface, binary compatibility considerations, 271
of packages, binary compatibility considerations, 257
examples
access control, 106
fields, methods, and constructors
default, 108
private, 111
protected, 110
public, 109
arrays, 212
classes, public and non-public, 107
declarations
fields, 162
import, 128
methods, 180
default-access methods, constructors, and fields, 108
exceptions, 224
fields
interface, ambiguous inherited, 204
interface, multiply inherited, 205
multiply inherited, 165
re-inheritance of, 166
hiding, 181
vs. overriding, 182
of variables
class, 162
instance, 163
inheritance
accessing members of inaccessible classes, 152
class members, 149
default access, 149
public, protected, and private access, 150
multiple, with superinterfaces, 146
with default access, 149
with private access, 151
with protected access, 150
with public access, 150
methods
abstract declarations, 207
invocation of hidden class, 184
examples (continued)
methods (continued)
private, 111
protected, 110
public, 109
overloading, 181
overriding, 180
vs. hiding, 182
incorrect, 181
because of throws, 186
large example, 185
exceptions
See also binary, compatibility; compile-time errors; errors;
(chapter), 219
asynchronous, causes and handling of, 224
caller, determination of, 222
causes of, 220
checked
constructors, declaring with throws clause in method declarations, 175
defining new exception classes as, 226
Exception, 226
in an instance initializer, 188
methods, declaring with throws clause in method declarations, 175
in a static initializer, 189
UnsatisfiedLinkException, 236
classes
Error, 221
Exception, 226
RuntimeException, 222
unchecked exceptions found in, 176
Throwable, 219, 221
errors
AbstractMethodError, 268
ClassCircularityError, 144, 258
meaning, 233
ClassFormatError, meaning, 233
Error, 226
ExceptionInInitializerError, 241, 304
IllegalAccessError, 258, 272, 358
meaning, 235
IncompatibleClassChangeError, 264, 269, 272, 357
meaning, 235
InstantiationError, meaning, 235
exceptions (continued)
errors (continued)
LinkageError, 233, 234
loading and linkage, 227
NoClassDefFoundError, 240
meaning, 233
NoSuchFieldError, 264
meaning, 236
NoSuchMethodError, 267, 273, 357
meaning, 236
OutOfMemoryError, 176, 233, 241, 242, 321, 334, 338, 340, 360
UnsatisifedLinkError
meaning, 236
VerifyError, 269, 272
meaning, 234
VirtualMachineError, 227
example, 224
handlers
compile-time checking, 221
how established, 219
in try statements, 306
handling of, 222
asynchronous, 224
run-time testing, 320
hierarchy, 226
integer divide by zero, 34
NegativeArraySizeException, 321, 338
never thrown for
assignment conversions, 66
information loss due to narrowing primitive conversions, 61
information loss sue to widening primitive conversions, 59
widening reference conversions, 63
NullPointerException, 194
parameters
See also variables
declaration, 306
description, 49
initial value, 51
scope, 86, 306
precise, 223
RuntimeException, 395
synchronization integrated with mechanism for handling, 220
exceptions (continued)
thrown for, narrowing reference conversions, 63
uncaughtException method, when invoked, 220
unchecked, 226
unchecked runtime
ArithmeticException, 324, 376
ArrayIndexOutOfBoundsException, 394, 399
ArrayStoreException, 217, 320, 395, 398
ClassCastException, 320, 372, 395
casting conversion requirements that can result in, 75
IndexOutOfBoundsException, 212, 321, 364
NullPointerException, 213, 222, 321, 358, 361, 364, 366, 394, 399
RuntimeException, 226, 395
execution
See also declarations; evaluation; initialization; linking; loading
(chapter), 229
order, thread rules, 433
of statements for their effect, 275
exit
virtual machine, criteria for, 249
exponent
See value set
expressions
See also fields; methods; statements
(chapter), 317
abrupt completion of, as reason forabrupt statement completion, 277
additive operators
evaluation, 377
for numeric types, evaluation, 381
array
access, evaluation, 364
assignment, evaluation, 394, 399
creation, evaluation of, 337
assignment
conversion, 66
definite assignment, 407, 412
operators, evaluation, 392
as statements, 287
expressions (continued)
bitwise
binary operators, evaluation, 388
complement, evaluation, 371
boolean
operators
!, definite assignment, 414
&&, definite assignment, 413
?, definite assignment, 414
||, definite assignment, 413
assignment, definite assignment, 415
constant, definite assignment, 412
equality, evaluation, 388
logical, evaluation, 389
cast, evaluation, 372
compound, assignment operators, evaluation, 398
conditional
and operator &&, evaluation, 390
operator ? :
definite assignment, 414
evaluation, 391
or operator ||, evaluation, 390
definite assignment and, 412
division, evaluation, 374
equality operators, evaluation, 386
field access, evaluation, 341
instance creation
evaluation of, 330
as statements, 286
integer bitwise operators, evaluation, 389
logical
comparison operators, evaluation, 388
complement !, evaluation, 371
method invocation
evaluation, 345
evaluation order, 356
as statements, 287
multiplication *, evaluation, 373
multiplicative operators *, \xda , %, evaluation, 373
names
context in which a name is classified as, 95
qualified, meaning of, 102
simple, meaning of, 101
numeric
comparison, evaluation, 384
expressions (continued)
numeric (continued)
equality operators, evaluation, 387
operators
++, definite assignment, 416
--, definite assignment, 416
precedence, evaluation, 325
parenthesized
evaluation of, 330
evaluation of, precedence effect of, 325
post-decrement --
evaluation of, 368
as statements, 287
postfix, evaluation, 367
post-increment ++
evaluation of, 367
as statements, 287
pre-decrement --
evaluation of, 369
as statements, 287
pre-increment ++
evaluation of, 369
as statements, 287
primary, evaluation of, 327
See also
arrays, access expressions;
arrays, creation;
expressions, parenthesized;
fields, access expressions;
instance, creation;
literals;
methods, invocations;
this keyword
reference equality operators ==, !=, evaluation, 388
relational operators <, >, <=, >=, evaluation, 384
remainder operator %, evaluation, 376
run-time checks of, 319
semantics and evaluation rules, (chapter), 317
shift operators <<, >>, >>>, evaluation, 383
simple assignment operator =, evaluation, 393
statements
definite assignment, 417
specification, 284
expressions (continued)
string concatenation +, evaluation, 378
superclass access, evaluation, 344
type
vs. class of object, 52
comparison instanceof, evaluation, 385
how determined, 52
usage in, 46
unary
minus -, evaluation, 370
operators, evaluation, 368
plus +, evaluation, 370
values, variable as, 318
extends clause
See also classes; implements; object-oriented concepts
in class declaration, specifying direct superclasses with, 142
in interface declaration, 201
F

Feeley, Mark, 224
fields
access control
default, example, 108
private, example, 111
protected, example, 110
public, example, 109
access expressions, evaluation, 341
of an array, 92, 214
of a class
binary compatibility considerations, 262
declarations, 153
examples of, 162
final, 156
binary compatibility considerations, 264
volatile declaration not permitted for, 158
multiply inherited, example of, 165
non-static
default values, 51
explicit constructors not permitted to use, 193
hiding example, 163
fields (continued)
of a class (continued)
non-static (continued)
initializers for, 159
initialization of, 158
invocation of initializers during instance creation, 242
specification, 48
re-inheritance of, example, 166
static
binary compatibility considerations, 266, 271
and final, binary compatibility considerations, 264
hiding of, example, 163
initialization of, 158, 189
initialization of, during the preparation phase of linking, 234
specification, 48
term definition and declaration, 155
transient, 156
binary compatibility considerations, 266
volatile, 156
declarations
binary compatibility considerations, 273
as declared entity, 81
hidden
accessing with
super keyword, 344, 345
this keyword, 283
of an interface
ambiguous inherited, example, 204
binary compatibility considerations, 273
declarations, 203
examples, 204
initialization, 204
during the preparation phase of linking, 234
multiply inherited example, 205
public by default, 203
names, naming conventions, 115
public, by default in interface declaration, 202
references to, binary file format requirements, 253
references, active use, 238
shadowing, 86
fifth dimension, 339
files
binary, format, 252
systems, storing packages in, 119
Finagle's Law, 219
final modifier
See also declarations; modifiers
anonymous class is always implicitly, 335
classes
binary compatibility considerations, 258
declaration of, 139
exception parameter, may not be assigned, 306
fields
binary compatibility considerations, 264
declaration and use, 156, 203
final by default in, interface declaration, 203
not allowed with volatile, 158
formal parameters, 168
methods
binary compatibility considerations, 268
declaration and use, 172
not permitted in interface method declarations, 206
reasons why constructors cannot be, 191
finalization
See also exceptions; linking
finalizable, as object attribute, 246
finalize method, as member of Object class, 45
finalized, as object attribute, 246
finalizer method calls, unordered nature of, 247
finalizer-reachable, as object attribute, 246
finally clause, exception handling use, 223
implementing, 246
of instances, 245
implementation procedures, 246
float type, 35
See also floating-point
floating-point
See also arithmetic; numbers; types
algebraic identities, limits on use of, 325
float type, floating-point literal specification, 24, 33
floating-point (continued)
literals
largest and smallest, 24
term definition and specification, 24
operations, 37
required behavior, 38
types and values, term definition and specification, 35
flow analysis
See also security
conservative, required for definite assignment of local variables, 407
Foote, Samuel, 305
for statement
definite assignment, 422
ForInit part
initialization by, 295
scope of local variable declared in, 86
header, local variable declaration in, 281
in scope of a local variable, 86, 296
specification, 295
form feed
escape sequence, 29
Forman, Ira, 251
forward reference
compile-time error in
initializers, 160
forward references
to types allowed before declaration, 86
FP-strict
actual arguments, 169
and addition, 382
and casts, 372
classes, 139
classes, interfaces, methods, constructors and initializers, 319
compile-time constant is always, 406
constructors, 191
and division, 375
expression
term definition, 318
interfaces, 200
methods, 173
overriding, 178
and multiplication, 374
and return statement, 302
value set conversion within, 65
Franklin, Benjamin, 229
Frost, Robert, 199, 310, 315, 445
G

Gabriel, Richard P., 6
Geisel, Theodore, 132
Gilbert, W. S., 197
goal symbols
CompilationUnit, 123
syntactic grammar use, 10
Input, lexical grammar use, 9
Goldberg, Adele, 6
goto statement
See labeled statements
gradual underflow
See also exceptions; floating-point; IEEE 754 standard; numbers
support required for, 38
grammars
See also languages; lexical; semantics
(chapter), 9
context-free, term definition, 9
difficulties with, as given in body of Java Language Specification, 449
if statement, dangling else handling, 284
lexical
(chapter), 13
term definition, 9
notation, 10
syntactic, term definition, 10
H

Hammerstein, Oscar, II, 133
Harbison, Samuel, 6
Harding, Warren G., 307
hexadecimal
See also numbers
base, permitted in integer literals, 21
numerals, specification, 22
hiding
See also scope
by class methods, 178
of field declarations, in superclasses and superinterfaces, 154
hiding (continued)
of fields, 136
bypassing using super, 345
term definition, 154
hidden class methods, invocation of, example, 184
of interface field declarations, in superinterfaces, 203
of interface fields, term definition, 203
of interface member type declarations, 208
of interface member types, term definition, 208
of interfaces, 199
of member types, term definition, 187
method
example, 181
impact on checked exceptions, 176
requirements, 178
of methods, 136
vs. overriding, example, 182
of types, by member types, 136
of variables
class, example of, 162
instance, example of, 163
hierarchy
exception, 226
Higginson, Thomas Wentworth, 203
Hoare, C. A. R., 1, 6
horizontal tab
escape sequence, 29
host
and creation, storage and observability of packages and compilation units, 120
may not restrict packagesin a database, 130
and observable compilation units, 123
optional restriction on packages in a file system, 129
hypothetical analysis
of definite unassignment, 412
I

identifiers
See also fields; names; scope; variables
identifiers (continued)
those that are not names, 83
in labeled statements, distinguished from those in declarations, 84
term definition and specification, 19
identity
conversion
in assignment conversion context, 66
in casting conversion context, 72
in method invocation conversion context, 71
specification, 58
IEEE 754 standard, 6
See also numbers
floating-point
conversion of numbers to, 24
types conformance to, 35
if statements
See also statements
dangling else, handling of, 285
definite assignment, 420
if-then statement, specification, 288
if-then-else statement, specification, 288
specification, 287
implement
See also classes; extends clause; interfaces
implements clause, 201
class declaration, specifying direct superinterfaces with, 144
term definition, 91, 145
import
See also packages; scope
automatic, 128
declarations
example, 128
single-type, 126
term definition, 125
type-import-on-demand, 127
imported types
as declared entity, 82
scope of, 85
as part of a compilation unit, 123
single-type
may not declare top-level type in same compilation unit, 130
and meaning of a simple type name, 99
import (continued)
single-type (continued)
scope, 85, 125
and shadowing, 87, 126
type-import-on-demand, 96
and meaning of a simple type name, 100
scope, 85, 125
and shadowing, 87, 127
indexing
of arrays, 211
inexact results
See also numbers
rounding behavior, 38
infinity
See also numbers
representation of, 25
signed, produced by floating-point overflow, 39
inheritance
See also object-oriented concepts; scope
in class
examples of, 149
of members, 148
of members, with public, protected, and private access, examples, 150
with default access, example, 149
of fields
in class declarations
multiply inherited from interfaces, example of, 165
reinheritance of, example of, 166
in interface declarations
ambiguous inherited, example, 204
multiply inherited, example, 205
of members, 90
of methods
in class declarations, 177
with the same signatures, 179
in interface declarations, 206
multiple
See also superinterfaces
example, 146
term definition, 90
initialization
See also control flow; linking
of arrays
in creation, to default value, 338, 48
initialization (continued)
of arrays (continued)
using array initializers, 212
of classes, 236
detailed procedure, 239
of classes and interfaces, when it occurs, 236
detailed procedure, 239
of fields
in classes, 159
in interfaces, 204
of for statement, 295
of interfaces, 236
detailed procedure, 239
for variables, array, 212
initializers
See also creation; execution
array
in array creation expression, 338
arrays, 211
executing, in Test class example initialization, 231
for fields
in class, 159
in interface, 204
instance
See instance initializer
FP-strict, 319
instance variable, 195
lacking in a blank final, 50
local variable
in scope of a local variable, 86, 296
static, 158, 189
binary compatibility considerations, 271
static
FP-strict, 319
variable
FP-strict, 319
in scope of local variable, 85, 280
for variables
class, 158
during class or interface initialization, 159
instance, 159
during instance creation, 242
inner class
See also nested class
anonymous class is always, 335
inner class (continued)
of another class, 140
direct, 140
every local class is an, 277
in a qualified class instance creation expression, 331
and qualified super method invocation, 355
qualified superclass constructor invocation of, 193
as superclass of an anonymous class, 334
term definition, 140
input
See also files
elements, term definition, 16
Input goal symbol, lexical grammar use, 9
tokens, 16
instance initializer, 135
allows field access through super, 344
anonymous class, 336
and checked exceptions, 221
as components of a class body, 147
containing a throw statement, 304
definite assignment of variables before, 418
execution during constructor invocation, 195
is not a member, 148
may not contain a return statement, 301
must be able to complete normally, 189
overview, 136
term definition, 188
and unreachable statements, 310
when reachable, 311
instance(s)
See also classes; interfaces; object-oriented concepts
creation, 42, 241
constructor
invocation by creation expressions, 190
parameter assignment during, 242
use in, 190
expression evaluation, 330
order, 334
expressions as statements, 287
invocation of initializers for instance variables during, 242
instance(s) (continued)
creation (continued)
method dispatching during, 244
enclosing
determining immediate, 332
with respect to superclass, 194
with respect to superclass of an anonymous class, 333
immediate as first argument to constructor, 334
immediately, 141
with respect to a class, 141
nth lexical used when evaluating method invocation, 356
nth lexically, 141
restrictions on references to, 194
finalization of, 245
implementation procedures, 246
initializer
See instance initializer
instanceof operator
testing expression types with, 320
testing expressions with, 320
instantiation
preventing, with private constructors, 139, 197
methods
See methods, non-static
variables
See fields, class, non-static
instanceof operator
testing expression types with, 320
instantiation
term definition, 330
integers
See also arithmetic; integral types; numbers
converting to boolean values, 41
literals
longest permitted, 23
term definition and specification, 21
operations, 33
integral types
See also arithmetic; numbers; types
byte type, 33
char type, 33
int type, 33
long type, 33
integral types (continued)
short type, 33
values and operations, 33
interfaces
See also class(es); fields; methods; packages; subclasses; superclasses; superinterfaces
(chapter), 199
abstract methods, 205
accessibility, 105
as array element types, 210
binary compatibility considerations, 271
binary representation
binary file format requirements, 252
verification, 234
body, declarations, 202
and checked exceptions in initializers, 221
Cloneable, implemented by arrays, 214
declarations, 200
as declared entity, 81
dependent on a reference type
term definition, 201
directly dependent on a reference type
term definition, 201
fields
declarations, 203
examples, 204
inheritance
ambiguous, 204
multiply, 205
initialization, 204
FP-strict, 319
initialization, 236
detailed procedure, 239
java.io.Serializable, implemented by arrays, 214
linking, process description, 233
loading, 232
process description, 233
members, 91
binary compatibility considerations, 272
declarations, 202
inheritance from superinterfaces, 91, 202
names, access to, 202
methods
declarations, 207
examples, 207
interfaces (continued)
methods (continued)
overloading, 207
example, 208
overriding, 206
example, 207
names
fully qualified, 111
naming conventions, 113
preparation of, 234
public
binary compatibility considerations, 272
declaration, 200
references to, binary file format requirements, 255
in scope of imported type, 85, 125
Serializable, implemented by arrays, 214
superinterfaces
binary compatibility considerations, 258
of a class, 144
declaration of, 144
that depend on themselves, 201
unloading of, 248
invocation
alternate constructor, 193
constructor
determining arguments to, 334
expression evaluation, 335
expression evaluation, order, 336
language constructs that result in, 190
of hidden class methods, example, 184
method
conversion, 71
expression evaluation, 345
order, 356
how chosen, 319
superclass constructor, 193
iteration
See also control structures
continue statement, specification, 299
do statement, specification, 293
for statement, specification, 295
while statement, specification, 292
J

Java
digits, term definition, 19
.java suffix, as name for source files, 122
java package is always in scope, 125
java.lang
example, 121
may be named in a type-import-on-demand, 127
public type names automatically imported from, 119, 123
java.lang package
public type names automatically imported from, 128
public types defined in, list of, 128
letters, term definition, 19
Java programming language
See also grammars; languages; lexical; semantics; syntax
Johnson, Samuel, 13
K

Keats, John, 217
Keene, Sonya E., 6
Kelvin, Lord (William Thompson), 317
Kernighan, Brian W., 7
keywords
list of, 20
as token, 10
Kiczales, Gregor, 6
L

label
shadowing, 87
labeled statements
identifiers in, kept separate from those in declarations, 84
specification, 286
language
See also grammars; lexical; semantics; syntax
Beta, 3, 7
C, 1, 2, 7
C++, 1, 2, 7
Common Lisp, 6
language (continued)
Dylan, 6
Mesa, 5, 7
Modula-3, 3, 6
Smalltalk-80, 6
Lao-Tsu, 81
left-hand side
term definition, 9
length
of array, 213
not part of type, 210
letters
See also Unicode character set
Java, term definition, 19
lexical
See also semantics; syntax
grammar, term definition, 9
structure (chapter), 13
translations, steps involved in, 14
Liang, Sheng, 233
life cycle
See also objects
of objects, 246
line terminators, term definition, 16
linefeed (LF)
escape sequence, 29
handling in a
character literal, 26
string literal, 27
as a line terminator, not input character, 27
linking, 233
See also exceptions; execution; initialization; loading; run-time
classes, process description, 233
errors, 227
interfaces, process description, 233
in Test class example, at virtual machine startup, 230
literals
See also constants; fields; variables
boolean, term definition and specification, 25
character
escape sequences for, 28
term definition and specification, 26
evaluation of, 328
floating-point
largest and smallest permitted, 24
literals (continued)
floating-point (continued)
term definition and specification, 24
integer
largest and smallest permitted, 23
term definition and specification, 21
null, term definition and specification, 29
string
escape sequences for, 28
term definition and specification, 27
term definition and specification, 21
as token, 10
loading
See also ClassLoader class; execution; linking
classes, 232
errors, 227
interfaces, 232
process, 233
in Test class example, at virtual machine startup, 230
local class, 115, 135
declaration is part of a block, 277
and definite [un]assignment, 418
determining immediately enclosing instance when instantiating, 332
example(s), 141, 278
interaction with shadowing of parameters, 168
and meaning of a simple type name, 99
requirements for normal completion, 311
scope, 86, 278
as superclass of anonymous class being instantiated, 333
term definition, 277
local variables
See also scope; variables
declarations
definite assignment, 419
statements, 279
declarators and types, 279
definite assignment, required for, 407
initial value, 51
naming conventions, 116
restrictions on use in an inner class, 141
scope, 85, 280
shadowing, 86
specification, 49
locks
See also monitors; synchronization; threads
(chapter), 429
acquisition and release
by synchronized networks, 174
by synchronized statement, 304
interaction with variables, rules about, 436
rules about, 436
synchronization and, 445
long type, 33
See also integral types; numbers
integer literal specification, 23
value range, 33
lvalue
See variables, value of expression
M

Madsen, Ole Lehrmann, 7
magnitude
loss of information about, possibility of in narrowing primitive conversion, 60
Marx, Chico, 415, 423
Marx, Groucho, 148, 227, 415, 416, 417
mathematical functions
See arithmetic; numbers
Matthew, St., 209
Maybury, William, 7
member, 187
member class, 82, 113, 135, 136
See also member type
can have same name as a method, 167
canonical name of, 113
determining immediately enclosing instance when instantiating, 332
example(s), 140, 142, 194, 196, 278
fully qualified name of, 112
and public modifier, 137
as superclass of anonymous class being instantiated, 333
term definition, 187
member interface, 82, 111, 113, 135, 136, 187
See also member type
can have same name as a method, 167
member interface (continued)
canonical name of, 113
example(s), 140
fully qualified name of, 112
implicitly static, 188
implicitly static, 140
inner class may not declare, 140
term definition, 187
member type, 97, 99, 187, 199
See also nested type
binary name of, 253
and definite assignment, 426
in interfaces, 208
inherited by interfaces, 201
and the meaning of a qualified type name, 100
and the meaning of a simple type name, 99
members
See also class(es); fields; interfaces; methods
accessibility, 105
arrays, 92, 213
classes, 90, 148
binary compatibility considerations, 259
declarations, 147
inaccessible, accessing, example, 151
inheritance, examples, 149
private, inheritance examples, 151
inheritance and, 90
interfaces, 91, 202
binary compatibility considerations, 272
declarations, 202
inheritance, 91, 202
names, access to, 202
Object class, 45
of a package, 89, 119
packages, 89, 119
protected accessibility of, 105
reference type, as declared entity, 81
static, restricted in inner classes, 140
of superclasses, accessing with super, 344
term definition, 89
memory
exceptions
OutOfMemoryError, 241, 242
main, term definition, 431
master, of variables, term definition, 431
memory (continued)
OutOfMemoryError, 176
working, term definition, 431
Mesa, 5, 7
method(s), 167
abstract
binary compatibility considerations, 268
in classes, 170
in interfaces
overloading, 207
access control
default, example, 108
private, example, 111
protected, example, 110
public, example, 109
access, binary compatibility considerations, 261
accessible, and method invocation, 347
of array, 92, 214
body, 176
binary compatibility considerations, 270
class
See methods, static
classes, 167
abstract, 170
binary compatibility considerations, 267
body
declarations, 176
with no executable code, 176
constructors compared with, 190
declarations, 167
examples of, 180
final, 172
hidden, invocation of, 184
hiding by, 178
modifiers, 169
native
declarations, 173
semicolon as body of, 177
private, as implicitly final, 172
signature, 169
strictfp, declaration, 173
synchronized, declaration, 174
void, expression return statement not permitted in, 177
with same signature, inheriting, 179
declarations, 167, 200
binary compatibility considerations, 267
method(s) (continued)
as declared entity, 81
definite [un]assignment of blank final fields before, 418
definite assignment of variables before, 418
descriptor, 347
dispatching during instance creation, 244
equals, as member of Object class, 45
final, 172
binary compatibility considerations, 268
finalize, as member of Object class, 45
FP-strict, 319
getClass, as member of Object class, 45
hashCode, as member of Object class, 45
hiding of, 178
inheritance
in arrays, 92, 214
in classes, 177
in interfaces, 91, 202
instance
See method(s), non-static
of interfaces
declarations, 205, 207
overloading, 207, 208
overriding, 206, 207
semicolon as body of, 176
invocation
See also access control
conversion, 71
expression evaluation, 345
order, 346
expressions as statements, 287
how chosen, 319
qualifying type of
See qualifying type, of a method invocation
as members of a class, 90
method table creation during preparation phase of linking, 230
names
context in which a name is classified as, 94
naming conventions, 115
qualified, meaning of, 104
simple, meaning of, 104
native, 173
binary compatibility considerations, 269
method(s) (continued)
non-static
instance method as name for, 172
overriding by, 177
notify, as member of Object class, 45
notifyAll, as member of Object class, 45
overloading, 180
binary compatibility considerations, 270
example, 181
overriding, 178
binary compatibility considerations, 271
examples, 180, 181, 182, 185, 207
parameters
See also arguments; variables
binary compatibility considerations, 267
definite [un]assignment of, 425
description, 48
initial value, 51
is assigned when final, 168
must not be assigned if final, 168
shadowing, 86, 168
specification of, 168
private, in example of qualified names and access control, 111
public, interfaces, declarations, 205
references to, binary file format requirements, 254
result type, binary compatibility considerations, 268
scope of formal parameters, 85, 168
shadowing, 87
signatures, 169
static, binary compatibility considerations, 269
stop, as asynchronous exception cause, 220
synchronized, 174
binary compatibility considerations, 270
throws clause, binary compatibility considerations, 270
toString, as member of Object class, 45
uncaughtException
exception handling use, 223
when invoked, 220
and unreachable statements, 310
wait, as member of Object class, 45
when reachable, 311
Mitchell, James G., 7
modifiers
See also declarations
class, 137
constructor, 191
declaration
See abstract modifier; final modifier; private modifier; protected modifier; public modifier; static modifier; strictfp modifier; synchronized modifier;transient modifier
field, 154
interface, 200
method, 169
Modula-3, 3, 6
Molière, 9
Møller-Pedersen, Birger, 7
monitors
See also locks; synchronization
term definition, 429
Montaigne, Michael de, 167
Moon, David A., 6
Morlay, Bernard de, 118
N

named class
exceptions in instance initializer, 188
named type, 200
names
See also identifiers; scope; Unicode character set
(chapter), 81
ambiguous
handling of, 93, 96
reclassification of, 96
binary
implementation keeps track of types using, 129
term definition, 253
canonical, 82
is binary name of top-level type, 253
and single-type imports, 126
term definition, 113
and type-import-on-demand, 127
class, naming conventions, 114
names (continued)
conflicts
See also hiding
avoiding
in fields with multiple inheritance, 165
through context use, 94
through naming conventions, 113
constants, naming conventions, 116
conventions, 113
impact on name obscuring, 89
expression
context in which a name is classified as, 97
qualified, meaning of, 102
simple, meaning of, 101
fields, naming conventions, 115
fully qualified, of a top-level type, 129
interface
member, access to, 202
naming conventions, 114
meaning of, determining, 93
method, 167
context in which a name is classified as, 96
naming conventions, 115
qualified, meaning of, 104
simple, meaning of, 104
package
in compilation units, 123
context in which a name is classified as, 97
limited significance for access control, 120
naming conventions, 113
qualified, meaning of, 98
scope, 125
simple, meaning of, 98
unique, 132
importance of, 132
parameters, naming conventions, 116
qualified
access control and, 104
fully, 111
term definition, 81
resolving references to, during resolution phase of linking, 230
restrictions, types and subpackages, 120
names (continued)
rules on being the same
class members, 90
fields, 90
interface fields, 92
simple, 253
class cannot have same as enclosing class, 137
interface cannot have same as enclosing class, 200
term definition, 83
as subset of identifiers, 83
syntactic
categories, 93
classification of according to context, 94
term definition, 83
type
context in which a name is classified as, 96
qualified, meaning of, 100
simple, meaning of, 99
variables, local, naming conventions, 116
NaN (Not-a-Number)
See also numbers
and addition, 381
comparison results, 39
and division, 375
and multiplication, 373
predefined constants representing, 25
preventing use of algebraic identities in expression evaluation, 325
term definition and specification, 35
narrowing
See also conversion; numbers
primitive conversions
in assignment conversion context, 66
in casting conversion context, 72
not allowed in method invocation conversion context, reasons for, 71
reference conversions, specification, 63
native modifier
See also declarations; modifiers
methods
binary compatibility considerations, 269
declaration, 173
semicolon as body of, 177
reasons why constructors cannot be, 191
nested class, 135, 136
nested class (continued)
See also nested type
and definite [un]assignment of variables, 418
inner class is a, 140
interaction with shadowing of parameters, 168
local class is a, 277
may declare static members if non-inner, 140
name hides same name in enclosing scopes, 148
term definition, 135
nested interface, 135, 136, 199
See also nested type, 135
term definition, 199
nested type
binary name of, 253
declaration
in scope of a class member, 85, 147
declarations
included in scope of interface members, 85, 202
in scope of an interface member, 85, 202
Newton, Sir Isaac, 1
non-public
classes, in example of qualified names and access control, 107
nonterminal symbols
See also grammars
definition of, notation for, 10
term definition, 9
notation
See also names, naming conventions
grammar, 10
notification
wait sets and, 446
null
literal, term definition and specification, 29
qualifying a superclass constructor invocation, 194
type
literal as source code representation of the value of, 20
term definition and specification, 32
numbers
See also arithmetic; precision; types
numbers (continued)
conversions of and to
See conversions
errors in handling
See exceptions
manipulating
See arithmetic operators
numeric promotion
binary, 79
specification, 77
term definition, 56
unary, 78
primitive types
See byte type; char type; double type; float type; floating-point; int type; integers; integral type; long type; short type
related types
See boolean; characters; strings
Nygaard, Kristen, 7
O

object-oriented concepts
See class(es); encapsulation; fields; inheritance; method(s); objects
objects
See also arrays; classes; instances; interfaces; types
Class, array, 215
fields that reference, final modifier effect on changes to, 50, 156
finalization attributes, 246
life cycle, 246
Object class, 44, 215
operations on references to, 43
reachable, finalization implication, 246
reference
See references
state
impact of changes, 43
transient fields not part of, 156
term definition and specification, 42
unreachable, finalization implications, 246
obscured
declaration, term definition, 89
label, 85
obscured (continued)
by labels, 286
of labels, 286
observable
all compilation units in javaand java.lang are, 123
compilation unit
determined by host, 120
term definition, 123
package
and meaning of qualified package name, 98
term definition, 125
Occam, William of, 373
octal
See also numbers
base, permitted in integer literals, 21
numerals, specification, 22
one of phrase
grammar notation use, 12
operators
See also constructors; expressions; initialization; methods; numbers
arithmetic, numeric promotion, specification, 77
assignment, as only way to change the value of a primitive variable, 33
binary, evaluation order, 322
boolean, 40
compound assignment, evaluation order, 323
floating-point, 37
signed infinity produced by overflow, 39
signed zero produced by underflow, 39
integer
divide, divide by zero exception thrown by, 34
overflow not indicated by, 34
underflow not indicated by, 34
integral, 33
list of, 30
operands evaluated before, 324
precedence, in expression evaluation, 325
on reference types, 43
remainder, divide by zero exception thrown by, 34
string concatenation
constructor invocation by, 190
operators (continued)
string concatenation (continued)
creating new instances with, 42
thread, term definition, 431
opt subscript
grammar notation use, 10
optimization
during
preparation phase of linking, 235
resolution phase of linking, 235
final method inlining, 172
finalization, 245
reachable objects reduction, 246
linking
initialization phase of, 240
resolution strategies, 234
optional symbol
term definition, 10
order
evaluation
argument lists left-to-right, 326
binary operators, 322
compound assignment, 323
left-hand operand first, 322
operands evaluated before operations, 324
of other expressions, 327
parentheses and precedence respected, 325
execution, thread rules, 433
field initialization, at run-time, 204
finalizer invocations, implications of no ordering imposition, 247
of floating-point values, 37
of occurrence, initialization of types, 236
thread interaction, consequences of, 430
origin
of arrays, 211
output
See files
overflow
See also arithmetic; exceptions; numbers
floating-point operators, signed infinity produced by, 39
not indicated by integer operators, 34
overloading
See also object-oriented concepts; inheritance; methods
overloading (continued)
of abstract interface methods
declarations, 207
example, 208
of constructors, 195
binary compatibility considerations, 270
of methods, 180
binary compatibility considerations, 270
example, 181
term definition, 91, 180
overriding
See also object-oriented concepts; scope
examples, 181, 182, 185, 207
incorrect, 181
incorrect because of throws, example, 186
large example, 185
methods
abstract
in abstract classes, 170
of non-abstract instance methods, 171
binary compatibility considerations, 271
in interfaces, 206
example, 207
instance, 177
requirements in, 178
term definition, 91
P

packages
(chapter), 119
binary compatibility considerations, 257
canonical name of, 113
declarations
in compilation units, 124
shadowing, 125
as declared entity, 81
host support for, 120
importing all public types from a, 127
members of, 89, 119
named, in compilation units, 124
names
context in which a name is classified as, 94
fully qualified, 111
packages (continued)
names (continued)
naming conventions, 113
qualified, meaning of, 98
simple, meaning of, 98
unique, importance of, 132
observable, 125
scope of, 85
shadowing, 87
storing in a
database, 122
file system, 121
term definition, 119
unnamed
compilation units belonging to, 123
in compilation units, uses and cautions, 124
and fully qualified name of top-level type, 129
Paine, Thomas, 305
parameters
See also modifiers; variable
constructor, 191
assignment during instance creation, 242
binary compatibility considerations, 267
description, 49
initial value, 51
as declared entity, 81
definite [un]assignment of, 425
exception
description, 49
initial value, 51
scope, 86, 306
method
binary compatibility considerations, 267
description, 48
initial value, 51
specification of, 168
must not be assigned if final, 168
names, naming conventions, 116
scope, 85, 168
shadowing, 86, 168
Partridge, Eric, 135
Peirce, Charles, 407
Peretti, Hugo E., 30
performance
See optimization
platform-dependent
native methods are, 173
pointers
See references
polling
for asynchronous exceptions, 224
precedence
See also expressions
of operators, in expression evaluation, 325
precise
term definition, 223
precision
See also numbers
possible loss of
in narrowing primitive conversions, 60
in widening primitive conversions, 58
preparation
of classes, 234
of interfaces, 234
in Test class example, at virtual machine startup, 230
prescient store
actions, with threads, 438
preventing
instantiation, 197
with private constructors, 139
primitive
See also numbers
conversion
narrowing
in assignment conversion context, 66
in casting conversion context, 72
not allowed in method invocation conversion context, reasons for, 71
widening
in assignment conversion context, 66
in binary numeric promotion context, 79
in casting conversion context, 72
in method invocation conversion context, 71
in unary numeric promotion context, 78
types
as array element types, 210
changing value of variables, 33
fully qualified name for, 111
primitive (continued)
types (continued)
literal as source code representation of the value of, 21
term definition and specification, 32
variables of, specification, 48
priority
thread, 445
private modifier
See also declarations; modifiers
access
determining, 105
inheritance of class members, example, 151
cannot be used for local classes, 278
class, pertains only to member, 137
constructors
access control, example, 111
preventing instantiation with, 139
fields, access control, example, 111
inheritance with, example, 151
and interfaces, 200
members not inherited, 148
methods
abstract not permitted with, 170
access control, example, 111
in example of qualified names and access control, 111
as implicitly final, 172
overriding and hiding not possible with, 179
preventing instantiation by declaring constructors as, 197
top-level type may not use, 131
productions
term definition, 9
promotion
See also numbers
(chapter), 55
numeric, 77
binary, 79
specification, 79
specification, 77
term definition, 56
unary, 78
specification, 78
protected modifier
See also declarations; modifiers
protected modifier (continued)
access, 105
cannot be use for local classes, 278
class, pertains only to member, 137
constructors, access control, example, 110
fields, access control, example, 110
inheritance with, example, 150
and interfaces, 200
methods, access control, example, 110
top-level type may not use, 131
public modifier
See also declarations; modifiers
access, 105
inheritance of class members, example, 150
cannot be used for local classes, 278
classes
access control in, 105
binary compatibility considerations, 258
in example of qualified names and access control, 107
pertains only to top-level and member, 137
constructors, access control, example, 109
fields
access control, example, 109
interface, implicit in declaration, 203
implicit for interface member types, 208
inheritance with, example, 150
interfaces
binary compatibility considerations, 272
declarations, 200
methods
access control, example, 109
in interfaces, implicit in declaration, 205
superclasses, accessing instances of non-public subclasses through, 151
superinterfaces, accessing instances of non-public subclasses through, 151
Q

qualified
See also access; scope
access, term definition, 104
class instance creation, 330
and definite [un]assignment, 417
qualified (continued)
class instance creation expression, 84
protected accessibility of constructor, 106
protected accessibility of superclass constructor, 106
names
access control and, 104
expression, meaning of, 102
fully, 111
method, meaning of, 104
not permitted with parameters, 168
package, meaning of, 98
term definition, 81
type, meaning of, 100
super, 193
superclass constructor invocation, 193
and protected accessibility, 106
qualifying type
of a constructor invocation
term definition, 255
of a field reference, term definition, 253
of a method invocation
as compile-time information stored for use at run-time, 355
term definition, 254
Quayle, J. Danforth, 220
R

Raper, Larry, 251
reachable
See also scope
objects
finalization implications, 246
term definition, 246
recursive
term definition, 10
references
See also expressions; types
conversions
narrowing, 63
widening, 62
in assignment conversion context, 66
in casting conversion context, 72
in method invocation conversion context, 71
references (continued)
to fields, active use, 238
forward
permitted in
class type usage, 131
interface type usage, 199
object, value of array variables as, 210
operations, 43
symbolic
binary file format requirements, 253
resolution, 235
term definition, 42
types
array, 210
class
See class
criteria for determining when two are the same, 45
interface
See interface
member name, scope of, 85
member, as declared entity, 81
specification, 41
in class declaration, 136
in interface declaration, 199
variables, specification, 48
release-to-release compatibility
See binary, compatibility
representation
binary, classes and interfaces, verification of, 234
resolution
late, in class and interface linking, 234
lazy, 231
name conflicts
avoiding with multiply inherited fields, 165
avoiding with multiply inherited types, 188, 208
context use in avoiding, 94
static, in class and interface linking, 234
symbolic references, 235
in Test class example, at virtual machine startup, 230
return statement
definite assignment, 423
instance initializer, 189
as reason for abrupt completion, 276
return statement (continued)
specification, 301
reuse, software
See binary, compatibility
right-hand side
term definition, 9
Ritchie, Dennis M., 7
Robson, David, 6
rounding
IEEE 754 standard default mode, support required for, 38
round to nearest, term definition, 38
round toward zero, term definition, 38
run-time
checks of expressions, 319
errors
See exceptions
RuntimeException class
unchecked exceptions found in, 176
state, linking binary objects into, 233
type, 52
validity checks, casting conversion requirements, 74
S

scope
See also declarations; inheritance; names; object-oriented concepts
of declarations, 85
formal parameter, 168
of formal parameters, 85, 168
of labels, 85, 286
of a local class, 86, 278
of local variable declared by for statement, 86, 295
member, 85, 147, 202
overview, 81
package, 125
parameters
formal, 168
shadowing rules, 86
of a top-level type, 85, 129
types declared by an import declaration, 85, 125
exception parameters, 306
in, term definition, 85
scope (continued)
initializer execution relative to issues of, 159, 160, 189
of a local class, 278
in method invocation expressions, 346
of names
of exception handler parameters, 86, 306
local variables, 49, 85, 280
parameters, formal, 85, 168
nested classes, variables and definite [un]assignment, 418
term definition, 85
type initialization order restrictions, 237
Sebastian, John, 288
security
See also access control; exceptions; types; virtual machine
internal symbolic reference table, role in maintaining, 232
type systems, verification importance to, 259
semantics
See also grammars; lexical; syntax
errors in, exceptions as mechanism for signaling at run-time, 219
expressions, (chapter), 317
names
context role, 94
determining, 93
expressions, 100
methods, 104
package, 98
types, 99
verifying during linking process, 234
semicolon (;)
as method body, 176
separators
list of, 29
as token, 10
sequences
escape, for character and string literals, 28
Seuss, Dr., 132
shadowing
absence of by statement labels, 286
of declarations, 86
by package declarations, 125
of exception parameters, 306
shadowing (continued)
of labels, 87, 286
of local classes, 278
by local variables, 283
of local variables, 280
and the meaning of a simple expression name, 101
and the meaning of a simple type name, 99
by member types, 187
of members by local variables, 282
of methods, 87
by a nested class, 148
package, 125
of packages, 87
parameters, 168
by single-type import, 87, 126
by type-import-on-demand, 87, 127
of types, 86
of variables, 86
Shakespeare, William, 30, 55, 118, 249, 436
Shelley, Percy Bysshe, 376
short type
See also integral types; numbers
value range, 33
side effects
See also expressions
from expression evaluation, reasons for, 317
signature
of constructors, 191
of methods, 169
methods with same, inheriting, 179
simple names
See also identifiers; names
expression, meaning of, 101
method, meaning of, 104
package, meaning of, 98
term definition, 83
type, meaning of, 99
single quote(')
escape sequence, 29
Smalltalk-80, 6
sorting
Unicode, reference for details on, 20
source code
compatibility, compared with binary compatibility, 257
source code (continued)
transformations that preserve binary compatibility, 253
Southey, Robert, 372
square brackets ([])
in array
type declaration, 210
variable declaration, 211
startup
virtual machine, 229
state
not shared by primitive values, 33
object
impact of changes, 43
transient fields not part of persistent, 156
statements
See also constructors; control flow; expressions; initializers; methods
(chapter), 275
break
definite assignment, 423
specification, 297
completion of
abrupt, reasons for, 276
normal, reasons for, 276
continue
definite assignment, 423
specification, 299
definite assignment, 417
do
definite assignment, 421
specification, 293
empty
definite assignment, 418
specification, 285
expression
definite assignment, 419
specification, 286
for
definite assignment, 422
specification, 295
general specification, 284
if
dangling else handling, 285
definite assignment, 420
if-then, specification, 288
if-then-else, specification, 288
statements (continued)
labeled
definite assignment, 419
scope of, 85, 286
specification, 286
local variable declarations
execution of, 283
specification, 279
return
definite assignment, 423
specification, 301
switch
definite assignment, 420
specification, 288
synchronized
definite assignment, 424
specification, 304
throw
definite assignment, 423
specification, 302
try
definite assignment, 424
try-catch, specification, 307
try-catch-finally, specification, 308
unreachable, conservative flow analysis detection of, 310
while
definite assignment, 421
specification, 292
static
restrictions in inner classes, 140
static context, 140
and method invocation, 355
and qualified superclass constructor invocation, 194
static initializer
definite [un]assignment within, 426
definite assignment of variables before, 418
inner class may not declare, 140
may not contain a return statement, 301
must assign all blank final class variables, 156
and unreachable statements, 310
when reachable, 311
static initializers
are not members, 148
and checked exceptions, 221
static initializers (continued)
overview, 136
static modifier
for fields
binary compatibility considerations, 266
creating during the preparation phase of linking, 234
default initialization of during the preparation phase of linking, 234
static modifier
for fields
initializers
as components of a class body, 147
for, 189
static modifier
See also declarations; modifiers
anonymous class is never, 335
cannot be used for local classes, 278
class, pertains only to member, 137
for fields, 155
declaring class variables using, 155
initialization of, 158
implicit in interface member declarations, 203
initialization of, 189
for methods
declaring class methods with, 171
hiding by, 178
not permitted in interface method declarations, 206
implicit for interface member types, 208
and interfaces, 200
reason why constructors do not use, 191
top-level type may not use, 131
Stein, Gertrude, 118, 370, 449
store
array, exception, 216
storing
packages
in a database, 122
in a file system, 121
strictfp modifier
constructors cannot be declared, 191
example(s), 325
for classes, 137
semantics, 139
and FP-strict expressions, 319
has no effect on method override, 178
strictfp modifier (continued)
interfaces, 200
methods may not be, 206
semantics, 200
methods, 169
semantics, 173
and widening conversion, 58
string(s)
See also characters; numbers; primitive types
character arrays are not the same as, 215
concatenation operator (+)
constructor invocation by, 190
creating new instances with, 42
conversion
context specification, 72
specification, 64
literals
escape sequences for, 28
interning of, 27
term definition and specification, 27
String class
creating instances, with string concatenation operator, 43
literal as source code representation of the value of, 21
specification, 45
string literal as reference to an instance of, 27
Stroustrup, Bjarne, 6
subclasses
See also class(es); interfaces; superclasses; superinterfaces
declaration, 143
direct, extending classes with, 142
relationship to direct subclass, 143
subpackage
as package member, 89, 119
and package observability, 125
super keyword
accessing
overridden methods with, 178
superclass members with, in expression evaluation, 344
binary compatibility considerations, 258
not permitted in
class variable initialization, 159
explicit constructor invocation, 192
super keyword (continued)
not permitted in (continued)
interface field declarations, 204
permitted
in instance initializers, 189
permitted in instance variable initialization, 160
superclass(es)
See also classes; fields; interfaces; methods; packages; subclasses; superinterfaces
accessing fields with super, expression evaluation, 344
of array is Object, 215
binary compatibility considerations, 258
direct
declaration, with extends clause, 142
term definition, 142
extending classes with, 142
public, accessing instances of non-public subclasses through, 151
superinterface(s)
See also classes; fields; interfaces; methods; packages; subclasses
binary compatibility considerations, 258, 272
direct
declaration, with implements clause, 144
term definition, 145
of interface, declaration, 201
public, accessing instances of non-public subclasses through, 151
term definition, 144
swapping
threads example, 439
Sweet, Richard, 7
switch
block, term definition, 289
switch statement
See also statements
definite assignment, 420
local variable declaration specification, impact on, 49
specification, 288
symbolic references
binary file format requirements, 253
resolution, 235
symbols
See also identifiers; name; variables
goal
CompilationUnit, 10
Input, 9
term definition, 9
nonterminal
notation for definition of, 10
term definition, 9
optional, term definition, 10
terminal, term definition, 9
synchronization
See also locks; threads
exception mechanism integration with, 220
initialization implications of, 239
locks, 445
use by synchronized methods, 174
use by synchronized statement, 304
synchronized modifier
See also modifiers
in method declarations, 174
methods, binary compatibility considerations, 270
reason why constructors do not use, 191
specification, 446
synchronized statement
definite assignment, 424
operations, 446
specification, 304
term definition, 429
volatile fields used for, with threads, 156
syntactic
See also lexical; semantics
classification, of a name according to context, 94
T

term definition
abrupt completion, 276, 322
access, 81
accessible, 104
control, 104
qualified, 104
action, 431
term definition (continued)
action (continued)
by main memory
lock, 431, 432
read, 431, 432
unlock, 431, 432
write, 431, 432
by thread
assign, 431, 432
load, 432
lock, 432
store, 431, 432
unlock, 431
use, 431
activation frame, 359
alphabet, 9
ambiguous member, 204
anonymous class, 330
applicable, 347
array, 209
components, 48, 209
element type, 209
type, 209
element, 209
empty, 209
initializer, 212
length of, 209
type, 209
assign, as thread action, 432
assignable to, 66
assignment, 66, 395
compatible with, 66
associated labels, 289
atomic, 431
binary
compatibility, 256
numeric promotion, 79
blank final, 50
block, 277
enclosing, 141
body
of class, 147
of constructor, 192
of interface, 202
of method, 176
break binary compatibility with, 256
break target, 298
caller, 222
term definition (continued)
can complete normally, 311
cast operator, 72, 368
catch clause, 219, 305
caught, 219, 302
checked exceptions, 221
class(es), 135, 136
abstract, 137
body, 147
declaration, 136
depends on a reference type, 144
direct inner, 140
directly depends on a reference type, 144
error, 221
exception, 222
final, 139
initialization, 236
inner, 140
inner of another class, 140
local, 277
modifiers, 137
of object, 52
runtime exception, 222
same, 46
strictfp, 139
unloading, 248
variables, 155
comments, 18
end-of-line, 18
traditional, 18
compatibility, binary, 256
compilation unit, 123
observable, 123
compile-time
declaration, 354
type, 47
compile-time type(s)
same, 45
complete
abruptly, 276, 321
normally, 276, 311, 321
component, 209
of array, 48, 209
type of array, 209
constant
expression
compile-time, 405
term definition (continued)
constructor(s), 190
anonymous, 335
default, 195
parameter, 49, 191
contain, 275
immediately, 275
context
static, 140
context of conversion, 56
continue target, 300
contract, 256
control
access, 104
conversion(s), 55
assignment, 66
casting, 72
contexts, 56
identity, 58
method invocation, 71
primitive
narrowing, 59
widening, 58
reference
narrowing, 63
widening, 62
string, 378
value set, 65
declaration(s), 82
array variable, 210
class, 135
variable, 48
compile-time, 354
constructor, 190
field, 153, 203
import, 125
instance variable, 48
interface, 202
local variable, 49
statement, 279
method, 167
package, 124
parameter
exception, 49
method, 48
shadowed, 86
single-type import, 126
top-level type, 128
term definition (continued)
declaration(s) (continued)
type-import-on-demand, 127
declarator, 279
default
constructor, 195
value, 51
definite assignment, 407
definitely assigned
after, 410
when false, 410
when true, 410
before, 410
definitely unassigned
after, 410
when false, 410
when true, 410
before, 410
direct
extension, 199
subclass, 142
superclass, 142
superinterface, 144, 201
directly implement, 199
dynamic method lookup, 358
dynamically enclosed, 222
element, 209
type, 209
empty
array, 209
statement, 285
enclosed, dynamically, 222
error classes, 221
escape
sequence, character and string, 28
Unicode, 14
evaluation
evaluated, 317
expression, result of, 317
order, 322
exception
caller of, 222
caught, 219
checked, 221
classes, 221
checked, 221
runtime, 222
unchecked, 221
term definition (continued)
exception (continued)
handler, 306
parameter, 49
polling for, 224
precise, 223
thrown, 219
unchecked, 221
executed, 317
exit of virtual machine, 249
expression, 317
constant, 405
statement, 287
extension, direct, 199
field, 153, 203
declaration, 153
final, 156, 203
non-static, 155
static, 155, 203
transient, 156
volatile, 156
finalizable, 246
finalization, object, 245
finalized, 246
finalizer, 245
finalize-reachable, 246
formal parameter, 168, 191
FP-strict expression, 318
frame activation, 359
goal symbol, 9
gradual underflow, 38
grammar
context-free, 9
lexical, 9
handler of exception, 306
handles, 223
hide, 178
a field, 154
an interface field, 203
an interface member type, 208
a member type, 187
identifier, 19
immediately contain, 275
implement, 91, 145, 177
directly, 199
implemented, 164
import
on demand, 127
term definition (continued)
import (continued)
single type, 126
in scope, 85
inexact, 38
infinities, 35
inherited, 90, 164
inherits, 177
initializer
array, 212
static, 189
variable, 158
input elements, 16
instance
of class, 42
immediately enclosing, 141
immediately enclosing with respect to a class, 141
initializer, 188
lexically enclosing, 141
method, 172
variables, 155
instantiation, 330
interface(s)
abstract, 200
body, 202
initialization, 236
same, 46
strictfp, 200
top-level, 199
invocation
alternate constructor, 193
superclass constructor, 193
iteration statements, 300
Java
digits, 19
letters, 19
keyword, 20
label, 286
associated, 289
language, 9
left of, to the, 17
left-hand side, 9
length of array, 209
line terminator, 16
linking, 233
literal, 21
boolean, 25
term definition (continued)
literal (continued)
character, 26
floating-point, 24
integer, 21
null, 29
string, 27
load action by thread, 432
loading, 232
local variable, 49
declaration statement, 279
locks, 431
lock action
by main memory subsystem, 432
by thread, 432
unlock action
by main memory subsystem, 432
by thread, 432
lookup
dynamic method, 358
loss of precision, 59
main memory, 431
master copy, 431
maximally specific, 350
member class, 187
member interface, 187
members, 89
ambiguous, 204
dynamic lookup, 358
memory
main, 431
working, 431
method(s), 167
abstract, 170, 205
applicable, 347
body, 176
class, 171
final, 172
hidden, 178
instance, 172
interface, 205
lookup, dynamic, 358
maximally specific, 350
more specific, 350
most specific, 347, 349, 350
native, 173
non-static, 172
overloaded, 180
term definition (continued)
method(s) (continued)
parameter, 48
signature, 169, 191
static, 171
synchronized, 174
modifiers
class, 137
constructor, 191
field, 155
interface, 200
method, 169
monitors, 429
more specific, 350
most specific, 349, 350
name(s), 83
ambiguous, 93
canonical, 113
contextually ambiguous, 96
expression, 96
method, 96
package, 96
qualified, 83
simple, 83
type, 96
unique package, 132
NaN (Not-a-Number), 35
narrowing
primitive conversion, 59
reference conversion, 63
nested class, 135
non-static
field, 155
method, 172
nonterminal, 9
normal completion, 276, 321, 322
notification, 446
numeric promotion, 77
object(s), 42
class of, 52
target, 358
obscured declaration, 89
observable
package, 125
operators, 30
additive, 377
assignment, 392
bitwise, 388
term definition (continued)
operators (continued)
cast, 372
equality, 386
logical, 388
multiplicative, 373
relational, 384
shift, 383
unary, 368
order of evaluation, 322
ordered, 37
overload, 180, 207
override, 206
package(s)
accessible, 105
unique names, 132
parameter, 168
constructor, 49, 191
exception handler, 49, 306
formal, 168, 191
method, 48, 168
pointer, 42
polling for exceptions, 224
precise exception, 223
precision, loss of, 59
preparation, 234
prescient store, 438
primitive conversion
narrowing, 59
widening, 58
priority, threads, 445
productions, 9
promotion
numeric, 77
binary, 79
unary, 78
qualified
access, 104
name, 83
qualifying type
of a field, 253
of a method invocation, 254
reachable, 246, 275, 311
read action
by main memory, 432
reason, 220, 276, 321
recursive, 10
reference, 42
term definition (continued)
reference (continued)
conversion
narrowing, 63
widening, 62
target, 356
types, 41
resolution, 235
late, 234
lazy, 234
result, 317
right of, to the, 17
right-hand side, 9
round
to nearest, 38
toward zero, 38
runtime exception classes, 222
run-time type(s)
same, 46
same
class, 45
compile-time type, 45
interface, 45
run-time class, 46
run-time interface, 46
run-time type, 46
scope, 85
separator, 29
signature, 169, 191
simple name, 83
specific
maximally, 350
more, 350
most, 349, 350
statements, 275
empty, 285
expression, 286
iteration, 300
labeled, 286
local variable declaration, 279
unreachable, 310
static
field, 155
initializers, 189
method, 171
resolution, 234
store
action by thread, 432
term definition (continued)
store (continued)
prescient, 438
strongly typed, 31
subclass, 143
direct, 142
subinterface, 202
superclass, 143
direct, 142
superinterfaces, 145, 201
direct, 144, 201
symbol
goal, 9
nonterminal, 9
optional, 10
terminal, 9
synchronizing, 429
target
break, 298
continue, 300
object, 358
reference, 356
terminal symbol, 9
thread, 429
thrown, 219, 220
throws clause, 175
token, 9, 16
top-level class, 135
type(s), 32, 52
boolean, 33
compile-time, 47
floating-point, 33, 35
import
on demand, 127
single, 125
integral, 33
null, 32
numeric, 33
primitive, 32
reference, 41
typed
strongly, 31
unary numeric promotion, 78
unchecked exception, 221
classes, 221
underflow
gradual, 38
unfinalized, 246
term definition (continued)
Unicode escapes, 14
unique package name, 132
unloading of classes, 248
unlock, 429
action
by main memory, 432
by thread, 432
unordered, 37
unreachable, 310
unreachable object, 246
use
action by thread, 432
value
default, 51
of expression, 318
value set
double, 35
double-extended-exponent, 35
float, 35
float-extended-exponent, 35
variable(s), 47, 431
class, 48, 155
final, 50
instance, 48, 155
local, 49
verification, 234
virtual machine exit, 249
visible, 87
wait set, 446
white space, 17
widening
primitive conversion, 58
reference conversions, 62
working
copy, 431
memory, 431
write action
by main memory, 432
terminal symbol
term definition, 9
terminators
line
carriage return and linefeed characters as, 27
term definition, 27
Test
program, how to run, 5
this keyword
accessing hidden fields with, 283
evaluation of, 328, 329
during instance creation, 242
not permitted
in class variable initialization, 159
in explicit constructor calls, 192
in interface field declarations, 204
permitted
in instance initializers, 189
in instance variable initialization, 160
qualified, 82
Thompson, William (Lord Kelvin), 317
threads
See also synchronization
(chapter), 429
constraints on relationships among actions of, 433
creation, 445
initialization implications of multiple, 239
interaction order, consequences of, 430
locks acquisition and release, by synchronized statement, 304
out-of-order writes example, 443
swapping example, 439
synchronized modifier, methods, declaration, 174
termination and virtual machine exit, 249
volatile fields use with, 156
throw
See also control flow; exceptions
throw statement
definite assignment, 423
as reason for abrupt completion, 276
specification, 302
throws clause, 189
of an anonymous constructor, 336
checked exception classes named in, 221
constructors, 192
binary compatibility considerations, 270
incorrect overriding because of, example, 186
methods, 175
binary compatibility considerations, 270
relation to instance initializers, 188
tokens
See also grammars
term definition, 9, 16
top-level class, 96, 111, 113
accessibility of, 105
and binary names, 253
canonical name of, 113
as package member, 89, 119
and private access, 105
and public modifier, 137
term definition, 135
top-level interface, 111
canonical name of, 113
as package member, 89, 119
term definition, 199
top-level type
binary name of, 253
fully qualified name of, 129
as part of a compilation unit, 123
scope, 85, 129
transient modifier
See also declarations; modifiers
fields, 156
binary compatibility considerations, 266
translations
lexical, steps involved in, 14
try statements
See also control flow; exceptions; statements
definite assignment, 424
exception handling role of, 222
scope of parameters to exception handlers, 86, 306
specification, 305
try-catch statement, specification, 307
try-catch-finally statement, specification, 308
types
See also arrays; classes; interfaces; primitive, types
(chapter), 31
argument values, method invocation conversion context, 71
array
canonical name of, 113
members of, 92
syntax and specification, 210
binary compatibility considerations, 256
boolean
Boolean literal specification, 25
term definition and specification, 40
types (continued)
char
character literal specification, 26
class
members of, 90
naming conventions, 114
compile-time, 52
data values relation to, 32
declaration of, as members of packages, 128
double, floating-point literal specification, 24
elements, of array, 209
errors, run-time testing, 320
expression
assignment conversion, 66
how determined, 52
of expressions, 318
float, floating-point literal specification, 24
floating-point, term definition and specification, 35
imported
as declared entity, 82
scope of, 85, 125
importing, compilation units, 123
int, integer literal specification, 21
integral, 33
interface
implications for variables and expressions, 52
members of, 91
naming conventions, 114
local variables, declaration of, 279
long, integer literal specification, 21
name(s)
context in which a name is classified as, 96
qualified, meaning of, 100
simple, meaning of, 99
named, 125
null, term definition and specification, 32
parameter, method invocation conversion context, 71
primitive
as array element types, 210
do not share state, 33
fully qualified name, 111
types (continued)
primitive (continued)
term definition and specification, 32
variables, specification, 48
qualifying
See qualifying type
reference
as array element types, 210
criteria for determining when two are the same, 45
member, as declared entity, 81
specifying with
class declaration, 135
interface declaration, 200
term definition and specification, 41
variables, specification, 48
run-time, 52
term definition, 52
term definition and specification, 32
usage, 46
in declarations and expressions, 47
of variable, how determined, 52
where used, 46
U

unary
numeric promotion, specification, 78
unassignment
definite
See definite unassignment, 407
unchecked
exceptions, 226
underflow
floating-point operators, signed zero produced by, 38
integer operators, not indicated by, 34
unfinalized
as object attribute, 246
term definition, 246
Unicode character set
See also characters
character sequences, represented by instances of class String, 45
composite characters, contrasted with the Unicode decomposed characters, 20
Unicode character set (continued)
escapes, 14
specification for handling, 14
term definition, 14
use when suitable font not available, 15
handling in package names, 122
lexical grammar use in terminal symbols, 9
sorting, reference for details on, 20
writing any character in, using ASCII characters in escapes, 15
unloading
See also linking; loading
of classes and interfaces, 248
of interfaces, 248
unqualified
class instance creation
and definite [un]assignment, 416
class instance creation expression, 95
unreachable
See also exceptions
objects
finalization implications, 246
term definition, 246
statements, conservative flow analysis detection of, 310
term definition, 246
V

value
return, specifying method with no, 167
value set
and contents of local variables, 280
conversion
See conversion, value set, 65
double, term definition, 35
double-extended-exponent, term definition, 35
float, term definition, 35
float-extended-exponent, term definition, 35
and FP-strict expressions, 318
and return statement, 302
values
See also assignment; initialization; primitive, types; variable
values (continued)
(chapter), 31
boolean, term definition and specification, 40
data, relation to types, 32
expressions, variables as, 318
floating-point, term definition and specification, 35
integral, term definition and specification, 33
primitive, term definition and specification, 32
reference
See references
relation to types, 32
variables, initial and default, 50
variables
See also data structures; fields; identifiers; scope
(chapter), 31
assignment conversion, 66
double, nonatomic treatment of memory operations on, 435
interaction with locks, rules about, 436
kinds of
array
See arrays, components
constructor parameters
See parameters, constructor
exception-handling parameters
See exceptions, parameters
instance
See fields, class, non-static
local
See variables, local
method parameters
See parameters, method
local, 279
declaration statements, 279
as declared entity, 81
definite assignment, declarations, 419
description, 49
naming conventions, 116
scope of, 86, 296
shadowing of names by, 283
long, nonatomic treatment of, memory operations on, 435
variables (continued)
primitive type
changing value of, 33
specification, 48
reference type, specification, 48
term definition and specification, 47
thread use constraints, 434
type of, how determined, 52
values
of expressions, 318
held by different types, summary of, 31
initial and default, 50
volatile, rules about, 437
verification
See also security
of binary representation, of classes and interfaces, 234
type safety dependence on existence and use of, 259
virtual machine
See also exceptions; optimization
class file format specified in, 252, 253
errors, 227
exception handling by, 219
exit, criteria for, 249
object life cycle in, 246
startup, 229
visible, 85
method, and meaning of method invocation, 346
term definition, 87
void keyword
See also methods
casting to, not permitted, 287
methods
expression return statement not permitted in, 177
no return value specified by, 167
volatile modifier
See also declarations; modifiers
fields, 156
used for synchronization by threads, 157
final declaration not permitted for, 158
variables, rules about, 437
W

wait
See also synchronization
wait sets, notification and, 446
Webb, Jim, 358
Weiss, George David, 30
while statement
See also control flow
definite assignment, 421
specification, 292
white space
term definition, 17
Whitman, Walt, 31, 80, 190, 273, 308
widening
See also conversions
primitive conversion
in assignment conversion context, 66
in binary numeric promotion context, 79
in casting conversion context, 72
in method invocation conversion context, 71
in unary numeric promotion context, 78
reference conversion, 62
in assignment conversion context, 66
in casting conversion context, 72
in method invocation conversion context, 71
Wordsworth, William, 54, 208, 320, 429
Z

zero
See also exceptions; numbers
divide by, exceptions thrown by integer divide and remainder operators, 34
Index

Contents | Prev | Next | Index Java Language Specification
Third Edition

Copyright © 1996-2005 Sun Microsystems, Inc. All rights reserved
Please send any comments or corrections via our feedback form

free hit counter