search for books and compare prices
Tables of Contents for Introduction to Programming Using Java
Chapter/Section Title
Page #
Page Count
Preface
vii
 
An Introduction to Java
1
30
Discussion
2
11
A hello world program
2
3
Compilation
5
1
Reading input
5
3
Concatenating strings
8
1
Variables
8
1
Numeric input and output
8
2
Applets
10
3
Experiments
13
14
Executing your first program
13
1
Extending your first program
14
2
When things go wrong
16
3
Executing and extending a program with input
19
1
Numeric input and output
20
1
Your first applet
21
3
Some common applet errors
24
3
Post-Laboratory Problems
27
2
Generating verse
27
1
Name replication
27
1
Errors galore
27
1
Predicting output
28
1
Temperature conversion
28
1
Bar graphs
28
1
Notes
29
2
Objects and Methods
31
33
Discussion
32
11
Objects
32
1
Creating objects
32
2
Coordinating objects
34
1
Building your own methods
35
1
Creating your own classes
36
2
Return values
38
1
Static methods
38
1
Detour: The main method
39
1
Assigning objects
39
2
Fonts and graphics for applets
41
2
Experiments
43
18
Printing out a point
43
1
Coordinating classes
44
1
Coordinating classes (graphical application)
44
1
Coordinating classes (textual application)
45
1
Your own method
46
1
Your own class
47
1
Return values
48
2
Static methods
50
3
Copying objects
53
2
Changing the font
55
4
Some simple pictures
59
2
Post-Laboratory Problems
61
1
Shifting points
61
1
Shifting points, revisited
61
1
Drawing a grid
61
1
Drawing a grid, revisited
61
1
Happiness
61
1
Initials
61
1
Rainbow Text
61
1
Other Drawing Methods
61
1
Determining Text Width
61
1
Notes
62
2
Building Your Own Classes
64
26
Discussion
65
7
Class capabilities
65
1
Program state
65
1
Object state
66
1
Constructors
66
2
Overloading
68
1
Creating a bordered square class
69
3
Experiments
72
15
Program state
72
1
Fields
72
1
Fields, revisited
73
1
Constructors
74
2
Constructors, revisited
76
1
Overloading read methods
77
2
Overloading
79
3
Borders
82
2
A bordered-square class
84
3
Post-Laboratory Problems
87
1
Shifting points
87
1
Refined points
87
1
Distance from origin
87
1
A date class
87
1
Converting dates to strings
87
1
Stick figures
87
1
House components
87
1
Boxed text
87
1
Notes
88
2
Boolean Expressions and Conditionals
90
31
Discussion
91
9
Boolean expressions
92
1
Operations on Booleans
93
2
Conditionals
95
2
The switch statement
97
3
Applet parameters
100
4
Experiments
104
14
Extending the SimpleDate class
104
1
Simple boolean methods
104
2
More boolean methods
106
1
Improved output
107
1
More fun with conditionals
107
2
Using the switch statement
109
1
Applet parameters
110
4
More applet parameters
114
4
Post-Laboratory Problems
118
2
Rethinking precedes
118
1
Incrementing a date
118
1
Is the date valid?
118
1
Correcting dates
118
1
Printing dates, revisited
118
1
Printing dates, revisited again
118
1
isWinter, revisited
118
1
Selecting colors, revisited
118
1
Selecting colors, revisited again
119
1
Multiple greetings
119
1
Parameterized drawings
119
1
Stick figures
119
1
Notes
120
1
Control Structures for Repetition
121
31
Discussion
123
6
Repetition
123
2
while loops
125
1
Detour: Overloading revisited
125
1
for loops
126
1
Detour: Arithmetic shorthand
127
1
Loops and applets
127
2
Experiments
129
19
Simple loops
129
2
Counting the day of the year
131
3
Simple for loops
134
2
Arithmetic shorthand
136
2
Rainbow text
138
3
A grid applet
141
4
A bouncing ball
145
3
Post-Laboratory Problems
148
2
daysUntil
148
1
daysSince
148
1
Reflection
148
1
Loop mechanisms
148
1
Grade averaging
148
1
Maximum grade
149
1
Revising the rainbow's shape
149
1
Revising the rainbow
149
1
A complete grid
149
1
Improving the bouncing simulation
149
1
Notes
150
2
Arrays and Hash Tables
152
21
Discussion
153
7
Counting scores
153
1
Arrays
154
2
Some important details
156
1
Counting words
157
1
Hash tables
158
2
Experiments
160
9
Counting scores
160
2
Introducing arrays
162
2
Arrays and references
164
1
Counting words
165
2
Hash tables
167
2
Post-Laboratory Problems
169
2
Improving daysUntilStart-OfMonth
169
1
Counting grades
169
1
Counting different scores
169
1
Copying arrays
169
1
Hashing words
170
1
Game boards
170
1
Notes
171
2
Recursion
173
23
Discussion
174
7
Mathematics and recursion
175
1
Fibonacci numbers
176
1
A guessing game
177
2
Exponentiation
179
2
Experiments
181
11
Simple recursive functions
181
5
Factorial
186
1
Fibonacci numbers
187
4
Exponentiation
191
1
Post-Laboratory Problems
192
3
Printing information on recursive calls, revisited
192
1
How large can a factorial be?
192
1
Large Fibonacci numbers
192
1
More efficient iterative computation of Fibonacci numbers
192
1
More efficient recursive computation of the Fibonacci numbers
193
1
Understanding the Fibonacci numbers
194
1
Counting steps during exponentiation
194
1
From recursion to iteration
194
1
Notes
195
1
Searching
196
25
Discussion
197
11
Sequences
197
1
Detour: Random sequences
197
1
Sequential search
198
1
Detour: The number game, revisited
199
4
Binary search
203
2
Problems with binary search
205
1
Finding the smaller elements of a sequence
205
3
Experiments
208
11
Integer sequences
208
2
Random sequences
210
1
Sequential search
211
1
The guessing game
212
1
Binary search
213
2
Problems with binary search
215
4
Post-Laboratory Problems
219
2
An iterative binary search
219
1
Evaluating binary search
219
1
Searching through names
219
1
Finding the first element
219
1
Extending the number game
219
1
Variations on search
219
1
Smallest, revisited
219
1
Further readings
220
1
Analyzing Algorithms
221
22
Discussion
222
6
Timing algorithms
222
1
Problems with wall-clock timing
222
1
Counting steps
223
1
Problems with counting
224
1
Binary search, revisited
225
1
Finding groups of smallest entries
226
2
Experiments
228
13
Wall-clock timing
228
3
Comparing wall-clock times
231
1
Counting steps
232
2
Comparing steps
234
2
Binary search
236
1
Finding the smallest element
237
1
Finding smaller elements
238
3
Post-Laboratory Problems
241
1
Plotting exponentiation
241
1
Comparing exponentiation
241
1
Plotting exponentiation, revisited
241
1
Comparing exponentiation, revisited
241
1
Sorting
241
1
Sorting, revisited
241
1
Notes
242
1
Graphics and Applets
243
16
Discussion
244
7
Applets
244
1
Painting pictures
245
1
A circle applet
245
1
Colors
246
1
Pixels vs. coordinates
246
1
Applet dimensions
247
1
Repainting
247
2
Applet parameters
249
2
Experiments
251
6
A colored circle applet
251
1
Experimenting with colors
251
1
Drawing vs. filling
252
1
Getting boundaries
253
1
Repainting
254
1
Setting parameters
255
2
Post-Laboratory Problems
257
1
A ``real'' drawing
257
1
A parameterized face
257
1
Rainbow text
257
1
Repositioning the moving circle
257
1
Multiple circles
257
1
Looping circles
257
1
Colors, revisited
257
1
Notes
258
1
Java's Abstract Windowing Toolkit
259
25
Discussion
260
9
Components
260
1
Events and control flow
261
1
An important event
262
1
Your first graphical application
263
2
Adding a Quit button
265
1
Adding more buttons
266
1
Separate listeners
267
2
Experiments
269
13
Your first AWT program
269
1
Creating multiple windows
270
1
Adding a Quit button
271
4
Adding a Help button
275
2
Improving action Performed
277
3
Building separate listeners
280
2
Post-Laboratory Problems
282
1
A customizable alert
282
1
Multiple frames
282
1
Multiple frames, revisited
282
1
Separate frames
282
1
Layout managers
282
1
Widgets
282
1
AWT widgets
282
1
Notes
283
1
Java's Abstract Windowing Toolkit, Continued
284
27
Discussion
285
9
The AWT, reviewed
285
3
Getting user input
288
2
Getting numeric input
290
4
Experiments
294
14
The AWT, reviewed
294
3
Getting input from the user
297
3
String manipulation
300
3
A simple calculator
303
1
Supporting real numbers
304
1
Adding a quit button
305
3
Post-Laboratory Problems
308
1
Observing the user
308
1
Capitalization
308
1
Passwords
308
1
Setting the size of text fields
308
1
Beginning a real calculator
308
1
Adding calculation
308
1
Notes
309
2
Object-Oriented Design
311
17
Discussion
312
7
Narratives
312
1
Question and answer sessions
313
1
Beginning coding
314
1
Narrating interactions
315
2
Diagrams of relationships
317
1
Generalization and encapsulation
317
2
Experiments
319
7
Determine potential objects and classes for an Othello simulation
319
1
Refining your descriptions
320
1
Beginning coding
321
1
Narrating interactions
321
2
Selective coding
323
1
Diagramming
324
1
Generalization
325
1
Post-Laboratory Problems
326
2
Describe a game
326
1
A simple Othello interface
326
1
Update Board
326
1
Update Rules
326
1
Changing Othello's board
327
1
Changing Othello's rules
327
1
Changing Othello's pieces
327
1
Inheritance
328
20
Discussion
329
5
Reuse
329
1
Inheritance
330
1
Overriding methods
331
1
From rectangles to squares
332
1
Multiple inheritance
333
1
Eperiments
334
12
Building a new point class
334
2
A simple extension of the Point class
336
2
Adding functionality to ExtendedPoints
338
2
Overriding methods
340
1
Overriding the toString method
341
2
From Rectangle to Square
343
3
Post-Laboratory Problems
346
1
Extending Points
346
1
Putting Points on a grid
346
1
Validating Squares
346
1
A hierarchy of shapes
346
1
Notes
347
1
Interfaces and Polymorphism
348
21
Discussion
349
7
Polymorphism
349
4
Interfaces
353
1
Generalized methods
353
1
Generality through inheritance
354
1
Building generalized methods with Java's interfaces
354
2
Experiments
356
10
Polymorphism
356
1
NewPoints and PointPrinters
357
3
Using ExtendedPoints
360
1
Printing points
361
2
Printing revisited
363
3
Post-Laboratory Problems
366
1
makePrintable vs. toString
366
1
Cloning points
366
1
Abstract classes
366
1
Interfaces vs. inheritance
366
1
Defining polymorphism
366
1
Notes
367
2
Primitive Types
369
21
Discussion
370
3
Representing integers
370
1
Representing reals
370
1
Coercion and casting
371
1
Representing characters
371
1
Precedence
372
1
Experiments
373
15
Facts about integers
373
1
Other integer types
374
1
Exceeding limits
375
2
Facts about reals
377
2
The limits of reals
379
1
Casting
380
3
Facts about characters
383
1
Precedence
384
2
Concatenating strings and numbers
386
2
Post-Laboratory Problems
388
1
Converting cases
388
1
Rounding or truncation?
388
1
Rounding or truncation, revisited
388
1
Encryption
388
1
Coercion
388
1
Unicode representation
388
1
Operators and precedence
388
1
Big integers and big reals
388
1
Notes
389
1
Vectors
390
34
Discussion
391
8
Vectors
391
1
Other vector capabilities
392
4
Determining the class of vector elements
396
1
Storing primitive values in vectors
397
2
Experiments
399
21
Heterogeneity and arrays
399
2
Vector basics
401
3
Testing limits
404
3
Additional vector methods
407
3
Course management
410
3
Modifying vector elements
413
4
Primitive objects
417
3
Post-Laboratory Problems
420
2
Default size of vectors
420
1
Implement sets
420
1
Other vector capabilities
420
1
Implementing vectors
420
1
Printing arrays
420
1
A grading program
421
1
Notes
422
2
Input, Output, Files, and Exceptions
424
20
Discussion
425
8
Output and System.out
425
1
Starting to build SimpleOutput
426
1
Output files
427
1
Exceptions
427
2
Closing files
429
1
Input
430
1
Input and System.in
430
1
Converting strings to other types
431
2
Experiments
433
10
Using System.out
433
1
Building your own output class
434
2
Output to files
436
1
Output to files, revisited
436
2
Starting to build your own input class
438
2
Reading numeric input
440
3
Post-Laboratory Problems
443
1
Printing integer arrays
443
1
Printing string arrays
443
1
Redirecting output to a different file
443
1
Redirecting output to standard output
443
1
Reading input from files
443
1
Reading parts of lines
443
1
Redirecting input
443
1
Notes
444