Programming and Problem Solving with Java

(やまだぃちぅ) #1
757

sentinel-controlled loops, 225–227
testing, 253–254
Event counter, 233, 256
Event handlers, 385, 398
extending in CopyStringclass, 410
reading data in, 398–401
Event handling, 385, 386
button creation, 385–387
creating/registering button event
listener, 387–390
event loops, 393–394
example of, 390–393
Event listeners, 385
creating, 387–390
registering, 387–390, 420, 421
Event loops, 393, 394 , 395, 421
Event source, 385, 389–390, 420
Events, 223, 385
Exceptionclasses, 437–438
Exception handler, 432
Exception-handling mechanism, 432–438
exception classes, 437–438
generating an exception with throw,
435–437
three parts to, 432
try-catch-finally statement, 432–435
Exceptionobjects, 437
Exceptions, 72, 130
catching/forwarding, 467
and testing, 466
throwing, 467, 468
Executable statement, 74
Executing applications, 20
Executing programs, 8
Execution
compilation related to, 14–15
tests performed during, 194
Execution trace, 191, 197
Exit condition, and event loop, 394, 420
exitmethod, 411
EXIT_ON_CLOSE, 378
Explicit casting, 196
Explicit type casting, 118, 157
Explicit type casts, 117, 140, 619
Exponential class algorithms, 455
Exponents, for floating-point values, 105
Exposed implementation, encapsulated
implementation versus, 178


Expressions, 60, 70
with arithmetic operators and their val-
ues, 109–110
avoid mixing integer and floating-point
values in, 140
calculations performed with, 108
equivalent, 162
and for statement, 447
index as, 490
mixing types within, 141
relational, 156
Expression statement, 450
extends clause, 337, 346
Extensibility, 19
External access, levels of, 367
External documentation, 299
External representation, 339
External scope, 342–345, 367
External scope rules, 345

F
FactIntapplet, HTML document causing
execution of, 669
FactIntclass, screen shots for, 663 , 664
Factorialclass algorithms, 455
Factorialfunction
applet written for, 661–664
calculating, 638–641
factorialmethod, execution of, 640
Factorial problem, code comparison for it-
erative and recursive versions of,
640–641
False assertions, 154
falsevalue
and boolean data type, 155, 156
and if-else form, 168
and logical expressions, 197
Fanning, Shawn, 658
Fear of starting, 28–29
Federal Information Processing Standard,
374
Fermat, Pierre de, 121
Fetch-execute cycle, 21
Field, 47, 420
FieldContents, 398
Field declarations, 54–59, 64, 71, 74, 75, 273
Fields, 50, 54, 58–59, 70, 73, 88, 274
in frame and data entry, 394–395
Free download pdf