| |
| |
List of Figures | |
| |
| |
List of Tables | |
| |
| |
List of Bug Alerts | |
| |
| |
Preface | |
| |
| |
| |
What is Programming? | |
| |
| |
| |
Mechanical Mouse in a Maze | |
| |
| |
| |
Object-Oriented Programming | |
| |
| |
| |
Computers and Data Representations | |
| |
| |
| |
Compilers | |
| |
| |
| |
Debugging | |
| |
| |
| |
Applications and Applets | |
| |
| |
| |
Classes and Methods I: Basics | |
| |
| |
| |
Some Simple Programs | |
| |
| |
| |
Building Simple Classes | |
| |
| |
| |
Text Output | |
| |
| |
| |
Drawing in Java | |
| |
| |
| |
Fundamental Data Types of Java | |
| |
| |
| |
Integers | |
| |
| |
| |
Declarations, Variables, and Assignment Statements | |
| |
| |
| |
Real Numbers | |
| |
| |
| |
Strings | |
| |
| |
| |
Debugging | |
| |
| |
| |
Pitfalls of Numbers, Strings, and Characters | |
| |
| |
| |
Decision Making | |
| |
| |
| |
The if Statement | |
| |
| |
| |
Constructing and Analyzing Boolean Expressions | |
| |
| |
| |
Comparing Objects | |
| |
| |
| |
switch Statements | |
| |
| |
| |
Debugging Decision Making | |
| |
| |
| |
More About Boolean Operators | |
| |
| |
| |
Classes and Methods II: Classes with Multiple Methods | |
| |
| |
| |
Building Classes with Multiple Methods | |
| |
| |
| |
Initialization of Instance Variables | |
| |
| |
| |
Scope of Variables | |
| |
| |
| |
Class Constructors with Arguments | |
| |
| |
| |
A Clock Class | |
| |
| |
| |
Iteration | |
| |
| |
| |
while Loops | |
| |
| |
| |
for Loops | |
| |
| |
| |
do-while Loops | |
| |
| |
| |
Loop Invariants | |
| |
| |
| |
Reading Input in a Loop | |
| |
| |
| |
Debugging Loops | |
| |
| |
| |
More Drawing in Java | |
| |
| |
| |
Iteration in Graphical Programs | |
| |
| |
| |
Classes and Methods III: Working with Objects | |
| |
| |
| |
Object-Oriented Programming | |
| |
| |
| |
Clocks Revisited | |
| |
| |
| |
Constructors | |
| |
| |
| |
Overloading Methods | |
| |
| |
| |
Methods Invoking Methods | |
| |
| |
| |
This | |
| |
| |
| |
Visibility Qualifiers | |
| |
| |
| |
Mutability | |
| |
| |
| |
Design Decisions, Representation Independence, and Debugging | |
| |
| |
| |
What Is main? | |
| |
| |
| |
One-Dimensional Arrays | |
| |
| |
| |
Array Basics | |
| |
| |
| |
Simple Array-Processing Loops | |
| |
| |
| |
Simple Computations on Numerical Data | |
| |
| |
| |
Arrays of Objects | |
| |
| |
| |
Debugging Arrays | |
| |
| |
| |
Sorting and Searching | |
| |
| |
| |
One-Dimensional Arrays and Graphics | |
| |
| |
| |
Nested Loops and Two-Dimensional Arrays | |
| |
| |
| |
Nested Loops | |
| |
| |
| |
Two-Dimensional Arrays | |
| |
| |
| |
Example: Crossword Puzzles | |
| |
| |
| |
Mouse in a Maze Revisited | |
| |
| |
| |
Drawing Pictures (advanced) | |
| |
| |
| |
Classes and Methods IV: Static Methods and Variables | |
| |
| |
| |
Class Variables and Class Methods | |
| |
| |
| |
Classes with No Instance Variables or Methods | |
| |
| |
| |
Modular Development and Debugging | |
| |
| |
| |
Interfaces | |
| |
| |
| |
The Java AWT Part I: Mouse Events (Optional) | |
| |
| |
| |
Mouse Events | |
| |
| |
| |
Objects in GUI Programs | |
| |
| |
| |
Debugging Classes | |
| |
| |
| |
Inheritance and Exceptions | |
| |
| |
| |
Packages | |
| |
| |
| |
Inheritance | |
| |
| |
| |
Exceptions | |
| |
| |
| |
Java AWT Part II (Optional) | |
| |
| |
| |
The Java AWT | |
| |
| |
| |
The Java AWT Event Model | |
| |
| |
| |
A Temperature Conversion GUI | |
| |
| |
| |
Using Conditionals with Reactive Components | |
| |
| |
| |
Drawing in a Frame | |
| |
| |
| |
The AWT Component Hierarchy | |
| |
| |
| |
The Canvas Class | |
| |
| |
| |
Designing the Screen Layout | |
| |
| |
| |
A Calendar Program | |
| |
| |
| |
Java and the Web | |
| |
| |
| |
Recursion | |
| |
| |
| |
Introduction to Recursion | |
| |
| |
| |
A First Example | |
| |
| |
| |
Divide and Conquer | |
| |
| |
| |
Under the Hood | |
| |
| |
| |
Processing Arrays Recursively | |
| |
| |
| |
Recursive Functions on Lists | |
| |
| |
| |
Dynamic Programming | |
| |
| |
| |
Recursive Drawings | |
| |
| |
| |
Text Processing and File Input/Output | |
| |
| |
| |
The Classes String and StringBuffer | |
| |
| |
| |
Sequential Files | |
| |
| |
| |
Debugging File I/O | |
| |
| |
| |
A Mail-Merge Application | |
| |
| |
| |
A Database Application | |
| |
| |
| |
Reading Input from the Web (Optional) | |
| |
| |
| |
Case Study: the Game of Reversi | |
| |
| |
| |
The Game of Reversi | |
| |
| |
| |
Organization of the Solution | |
| |
| |
| |
The Classes | |
| |
| |
| |
The Reversi Classes | |
| |
| |
| |
Other Java Features | |
| |
| |
| |
Comments | |
| |
| |
| |
No Preprocessor | |
| |
| |
| |
Data Types | |
| |
| |
| |
Control Structures | |
| |
| |
| |
The final Modifier | |
| |
| |
| |
Inner Classes | |
| |
| |
| |
Concurrency-Related Features | |
| |
| |
| |
The transient and native Modifiers | |
| |
| |
| |
Precedence Rules | |
| |
| |
| |
Classes in CSLib and the Java API | |
| |
| |
| |
Classes in the CSLib package | |
| |
| |
| |
Classes in the java.lang Package | |
| |
| |
| |
Classes in the java.util Package | |
| |
| |
| |
Classes in the java.awt Package | |
| |
| |
| |
Classes in the java.awt.event Package | |
| |
| |
| |
Classes in the java.applet Package | |
| |
| |
| |
Classes in the java.io Package | |
| |
| |
| |
UML Class Diagrams | |
| |
| |
| |
Specifying a Class | |
| |
| |
| |
Associations | |
| |
| |
| |
Inheritance and Generalization | |
| |
| |
| |
Aggregations | |
| |
| |
| |
Interfaces and Realization | |
| |
| |
| |
Javadoc and CSLib | |
| |
| |
| |
Javadoc | |
| |
| |
| |
The CSLib Package | |
| |
| |
Index | |