element( ), 446
elementAt( ), 488, 489
elementCount Vector data member, 488
elementData[ ] Vector data member, 488
elements( ), 489, 493, 494, 495
ElementType enumeration, 283, 435
else, 77–80
empty( ), 491, 492
EMPTY_LIST static variable, 479
EMPTY_MAP static variable, 479
EMPTY_SET static variable, 479
EmptyStackException, 491, 493
enableEvents( ), 748–749, 753
Encapsulation, 16–17, 19, 20–21, 122–123
and access control, 138
and scope rules, 43
end( ), 826
endsWith( ), 368
ensureCapacity( ), 378, 450, 489
entrySet( ), 464, 465, 467, 469, 496
enum, 255, 432, 458, 472
Enum class, 261, 432
methods, table of, 432–433
EnumConstantNotPresentException, 218
enumerate( ), 423, 425, 429
Enumeration interface, 487, 489, 491, 503, 504
program demonstrating, 489–491
Enumeration(s), 14, 255–264, 491
= = relational operator and, 256, 262
as a class type in Java, 255, 259–261
constants, 255, 256, 259, 260, 261–262
constructor, 259–261
restrictions, 261
values in switch statements, using, 256–257
variable, declaring an, 256
EnumMap class, 468, 472
EnumSet class, 448, 458
methods, table of, 458
Environment properties, list of, 412
eolIsSignificant( ), 590–591
equals( ), 149–150, 181–182, 261–262, 272,
366–367, 387, 388, 391, 392, 393, 395, 400, 402,
412, 431, 432, 441, 442, 465, 467, 473, 474, 481,
494, 505, 508, 509, 602
versus = =, 368–369
equalsIgnoreCase( ), 367
Erasure, 318, 349–353, 354
and ambiguity errors, 353–354
bridge methods and, 351–353
err, 288, 409
Error class, 206, 215, 221, 587
Errors
ambiguity, 353–354
autoboxing/unboxing and prevention
of, 271
compile-time vs run-time, 321–322
generics and prevention of, 320–322
raw types and run-time, 341
run-time, 12, 205
Event
delegation model, definition of, 638
design patterns, 849–850
dispatching thread and Swing, 867–868,
871, 873
driven programs, 637
multicasting and unicasting, 638–639, 850
Event handling, 620, 637–662
and adapter classes, 659–660
event classes, 639–649
by extending AWT components, 638,
748–754
and inner classes, 660–662
keyboard, 656–658
mouse, 653–656
and Swing, 868–871
See alsoDelegation event model
EventListener interface, 553
EventListenerProxy class, 553
EventObject class, 553, 639, 640, 921
EventSetDescriptor class, 850, 851, 852, 854
Exception class, 206, 219–220, 221
Exception classes and generics, 356
Exception handling, 12, 88, 98, 205–222, 296
block, general form of, 205–206
and chained exceptions, 13, 220, 221–222
and creating custom exceptions, 219–221
and default exception handler, 206–207, 213
Exceptions, built-in run-time, 205, 206, 207, 217
checked, table of, 218
constructors for, 214
unchecked RuntimeException, table of, 218
exchange( ), 799, 801
Exchanger class, 788, 799–801
exec( ), 403, 404, 406–407
execute( ), 801
Executor interface, 788, 801, 802
Executors, 788
using, 801–806
Executors class, 788, 802
ExecutorService interface, 788, 801, 802, 804
exists( ), 557
exitValue( ), 403, 407
1004 Java: The Complete Reference