Programming and Problem Solving with Java

(やまだぃちぅ) #1

770


Objects(continued)
objects within, 54
output and input of, 354–358, 367
and public interface, 274
state of, 257
writing and reading, 354
Object type, 333
Object types, 50
Observers, 136, 288, 289, 290, 291
and Listclass, 526–527
for rainfall amounts case study, 402
and SortedListclass, 544
Occupancy rates example, for
declaring/processing arrays, 493–494
occupants array, 494
Octal (base-8) numbers
int literals starting with zero as, 140
and literal constants beginning with
zero, 105
“Off-by-one” syndrome, 254
Olsen, Kenneth, 268
Olsen, Stan, 268
One-dimensional arrays, 483–493, 513,
571, 581, 582
accessing individual components of,
512
definition of, 486
instantiating, 512
processing components in, 512
OnTyme, 478
OOD.SeeObject-oriented design
Operands, grouping of operators with, 458
Operating system, 22, 34, 72
Operations, 155
Operations on matrices, 603
Operator precedence, 456, 457 , 458
Operators, 108, 468
different effects with those similar in
appearance, 195
precedence of, 165–166
relational, 156–158
Ordered lists
merging of, 566
sequential searching in, 671
Order of definition, with internal scope,
340–341
Order of evaluation

changing, 114–115
and string conversion, 120
Order of magnitude, 454
Ordinal data types, 481
OR operation, and short-circuit
evaluation, 163
OR operator (??), 161, 164, 481
otherObj, 345
otherObj.someInt, 345
outfile.dat, 219
Out-of-bounds array indexes, 490–491, 510
Out-of-bounds error, 490, 491
Output, 64–67, 70
adding to content pane, 380
devices, 15, 20, 21, 34
viewing with editor, 214
outputFrame, 377, 378
Output labels, 672
classes for, 333
outputPanemethod, 379
Overflow, 599, 600, 603, 620
and matrix manipulation case study,
612
Overloading, 347, 365, 367
and overriding, 348, 349
Overridden methods/fields, accessing, 349
Overriding, 326, 336, 339, 365, 367
and overloading, 348, 349

P
Package access, 132
packagekeyword, 294
Packages, 19, 46, 78, 294–299, 316
classes in, 315, 316
example of, 297–299
with multiple compilation units, 296
syntax for, 294–295
package statements, 316
Packard, Dave, 99
Parameter passing analogy, 244–245
Parameters, 242, 501
Parameter types, and signature of
method, 348
Parentheses
assignment expressions within, 229
data type names within, 116
matching, 87

T


E


A


M


F


L


Y


Team-Fly®

Free download pdf