List of Figures | p. x |
List of Tables | p. xvi |
List of Bug Alerts | p. xviii |
Preface | p. xx |
What is Programming? | |
Mechanical Mouse in a Maze | p. 4 |
Object-Oriented Programming | p. 11 |
Computers and Data Representations | p. 13 |
Compilers | p. 19 |
Debugging | p. 23 |
Applications and Applets | p. 25 |
Classes and Methods I: Basics | |
Some Simple Programs | p. 31 |
Building Simple Classes | p. 40 |
Text Output | p. 43 |
Drawing in Java | p. 46 |
Fundamental Data Types of Java | |
Integers | p. 57 |
Declarations, Variables, and Assignment Statements | p. 62 |
Real Numbers | p. 66 |
Strings | p. 71 |
Debugging | p. 77 |
Pitfalls of Numbers, Strings, and Characters | p. 88 |
Decision Making | |
The if Statement | p. 97 |
Constructing and Analyzing Boolean Expressions | p. 109 |
Comparing Objects | p. 117 |
switch Statements | p. 122 |
Debugging Decision Making | p. 128 |
More About Boolean Operators | p. 136 |
Classes and Methods II: Classes with Multiple Methods | |
Building Classes with Multiple Methods | p. 149 |
Initialization of Instance Variables | p. 152 |
Scope of Variables | p. 153 |
Class Constructors with Arguments | p. 156 |
A Clock Class | p. 157 |
Iteration | |
while Loops | p. 173 |
for Loops | p. 179 |
do-while Loops | p. 181 |
Loop Invariants | p. 183 |
Reading Input in a Loop | p. 184 |
Debugging Loops | p. 192 |
More Drawing in Java | p. 201 |
Iteration in Graphical Programs | p. 203 |
Classes and Methods III: Working with Objects | |
Object-Oriented Programming | p. 215 |
Clocks Revisited | p. 219 |
Constructors | p. 221 |
Overloading Methods | p. 223 |
Methods Invoking Methods | p. 226 |
This | p. 230 |
Visibility Qualifiers | p. 235 |
Mutability | p. 238 |
Design Decisions, Representation Independence, and Debugging | p. 242 |
What Is main? | p. 254 |
One-Dimensional Arrays | |
Array Basics | p. 263 |
Simple Array-Processing Loops | p. 269 |
Simple Computations on Numerical Data | p. 271 |
Arrays of Objects | p. 277 |
Debugging Arrays | p. 283 |
Sorting and Searching | p. 296 |
One-Dimensional Arrays and Graphics | p. 303 |
Nested Loops and Two-Dimensional Arrays | |
Nested Loops | p. 313 |
Two-Dimensional Arrays | p. 321 |
Example: Crossword Puzzles | p. 329 |
Mouse in a Maze Revisited | p. 336 |
Drawing Pictures (advanced) | p. 345 |
Classes and Methods IV: Static Methods and Variables | |
Class Variables and Class Methods | p. 365 |
Classes with No Instance Variables or Methods | p. 369 |
Modular Development and Debugging | p. 375 |
Interfaces | p. 388 |
The Java AWT Part I: Mouse Events (Optional) | |
Mouse Events | p. 399 |
Objects in GUI Programs | p. 405 |
Debugging Classes | p. 410 |
Inheritance and Exceptions | |
Packages | p. 423 |
Inheritance | p. 426 |
Exceptions | p. 449 |
Java AWT Part II (Optional) | |
The Java AWT | p. 473 |
The Java AWT Event Model | p. 482 |
A Temperature Conversion GUI | p. 485 |
Using Conditionals with Reactive Components | p. 491 |
Drawing in a Frame | p. 499 |
The AWT Component Hierarchy | p. 503 |
The Canvas Class | p. 505 |
Designing the Screen Layout | p. 509 |
A Calendar Program | p. 516 |
Java and the Web | p. 522 |
Recursion | |
Introduction to Recursion | p. 537 |
A First Example | p. 539 |
Divide and Conquer | p. 541 |
Under the Hood | p. 543 |
Processing Arrays Recursively | p. 546 |
Recursive Functions on Lists | p. 564 |
Dynamic Programming | p. 580 |
Recursive Drawings | p. 583 |
Text Processing and File Input/Output | |
The Classes String and StringBuffer | p. 607 |
Sequential Files | p. 609 |
Debugging File I/O | p. 615 |
A Mail-Merge Application | p. 619 |
A Database Application | p. 623 |
Reading Input from the Web (Optional) | p. 631 |
Case Study: the Game of Reversi | |
The Game of Reversi | p. 641 |
Organization of the Solution | p. 644 |
The Classes | p. 646 |
The Reversi Classes | p. 648 |
Other Java Features | |
Comments | p. 670 |
No Preprocessor | p. 671 |
Data Types | p. 671 |
Control Structures | p. 674 |
The final Modifier | p. 675 |
Inner Classes | p. 675 |
Concurrency-Related Features | p. 676 |
The transient and native Modifiers | p. 677 |
Precedence Rules | |
Classes in CSLib and the Java API | |
Classes in the CSLib package | p. 681 |
Classes in the java.lang Package | p. 684 |
Classes in the java.util Package | p. 687 |
Classes in the java.awt Package | p. 688 |
Classes in the java.awt.event Package | p. 695 |
Classes in the java.applet Package | p. 698 |
Classes in the java.io Package | p. 698 |
UML Class Diagrams | |
Specifying a Class | p. 700 |
Associations | p. 703 |
Inheritance and Generalization | p. 704 |
Aggregations | p. 704 |
Interfaces and Realization | p. 705 |
Javadoc and CSLib | |
Javadoc | p. 706 |
The CSLib Package | p. 708 |
Index | p. 735 |
Table of Contents provided by Syndetics. All Rights Reserved. |