| CHAPTER 1 Introduction to Computers and Programming | | | 1 | (32) |
| 1.1 Overview of Computers | | | 2 | (2) |
| | 4 | (7) |
| | 11 | (2) |
| 1.4 Overview of Programming Languages, Then and Now | | | 13 | (5) |
| 1.5 Processing a High-Level Language Program | | | 18 | (5) |
| 1.6 Problem Solving and Programming Using Classes | | | 23 | (2) |
| 1.7 Creating a Program in an Integrated Programming Environment | | | 25 | (1) |
| | 26 | (2) |
| | 28 | (1) |
| Answers to Quick-Check Exercises | | | 28 | (1) |
| | 29 | (1) |
| | 30 | (3) |
| CHAPTER 2 Problem Solving and Java | | | 33 | (38) |
| 2.1 The Software Development Method | | | 34 | (5) |
| 2.2 Applying the Software Development Method | | | 39 | (6) |
| 2.3 Overview of a Java Program | | | 45 | (4) |
| 2.4 Reserved Words and Identifiers | | | 49 | (3) |
| | 52 | (4) |
| | 56 | (4) |
| | 60 | (3) |
| | 63 | (2) |
| | 65 | (1) |
| Answers to Quick-Check Exercises | | | 65 | (1) |
| | 66 | (1) |
| | 66 | (2) |
| | 68 | (3) |
| CHAPTER 3 Methods, Statements, and Expressions | | | 71 | (48) |
| 3.1 Method Bodies: Where the Action Takes Place | | | 72 | (4) |
| | 76 | (7) |
| 3.3 Assignment Statements | | | 83 | (3) |
| 3.4 Operations and Expressions | | | 86 | (11) |
| | 97 | (5) |
| | 102 | (4) |
| 3.7 Writing Code with Style | | | 106 | (2) |
| 3.8 Common Errors and Debugging | | | 108 | (5) |
| | 113 | (1) |
| | 114 | (1) |
| Answers to Quick-Check Exercises | | | 115 | (1) |
| | 116 | (1) |
| | 117 | (2) |
| CHAPTER 4 Program Design with Methods and Graphics | | | 119 | (58) |
| 4.1 Building Programs from Existing Information | | | 120 | (5) |
| 4.2 Extending a Problem Solution | | | 125 | (5) |
| 4.3 Extending a Problem Solution through Inheritance | | | 130 | (3) |
| 4.4 Using Methods in Class Math | | | 133 | (10) |
| 4.5 Accessors, Modifiers, Constructors, and Class Methods | | | 143 | (6) |
| 4.6 Introduction to Computer Graphics | | | 149 | (16) |
| 4.7 Common Programming Errors | | | 165 | (2) |
| | 167 | (1) |
| | 168 | (1) |
| Answers to Quick-Check Exercises | | | 169 | (1) |
| | 170 | (1) |
| | 170 | (4) |
| | 174 | (3) |
| CHAPTER 5 Selection Structures | | | 177 | (70) |
| | 178 | (1) |
| | 179 | (13) |
| | 192 | (4) |
| 5.4 if Statements with Compound Statements | | | 196 | (3) |
| 5.5 Decision Steps in Algorithms | | | 199 | (10) |
| 5.6 Hand-Tracing an Algorithm | | | 209 | (3) |
| 5.7 Nested if Statements and Multiple-Alternative Decisions | | | 212 | (9) |
| 5.8 The switch Statement and SimpleGUI Menus | | | 221 | (13) |
| 5.9 Exceptions and try-catch Blocks | | | 234 | (2) |
| 5.10 Common Programming Errors | | | 236 | (1) |
| | 237 | (2) |
| | 239 | (2) |
| Answers to Quick-Check Exercises | | | 241 | (1) |
| | 241 | (1) |
| | 242 | (2) |
| | 244 | (3) |
| CHAPTER 6 Repetition Structures | | | 247 | (60) |
| 6.1 Counting Loops and the while Statement | | | 248 | (4) |
| | 252 | (8) |
| 6.3 State-controlled Loops | | | 260 | (8) |
| 6.4 Loop Design and the do-while Loop | | | 268 | (8) |
| | 276 | (7) |
| 6.6 Loops in Graphics Programs (Optional) | | | 283 | (6) |
| 6.7 Introduction to Recursive Methods (Optional) | | | 289 | (3) |
| 6.8 Debugging and Testing Methods with Loops | | | 292 | (3) |
| 6.9 Common Programming Errors | | | 295 | (1) |
| | 296 | (2) |
| | 298 | (1) |
| Answers to Quick-Check Exercises | | | 298 | (1) |
| | 299 | (1) |
| | 300 | (4) |
| | 304 | (3) |
| CHAPTER 7 Arrays and Vectors | | | 307 | (74) |
| 7.1 Array Declarations and Indices | | | 308 | (6) |
| 7.2 Processing Arrays and Array Elements | | | 314 | (9) |
| 7.3 Operations on Whole Arrays | | | 323 | (8) |
| 7.4 Searching and Sorting an Array | | | 331 | (6) |
| 7.5 Analysis of Algorithms: Big-O Notation (Optional) | | | 337 | (3) |
| | 340 | (6) |
| | 346 | (5) |
| 7.8 More Input/Output: Using Files and displayRow (Optional) | | | 351 | (9) |
| 7.9 Multidimensional Arrays--Arrays of Arrays (Optional) | | | 360 | (7) |
| 7.10 Common Programming Errors | | | 367 | (2) |
| | 369 | (2) |
| | 371 | (1) |
| Answers to Quick-Check Exercises | | | 372 | (1) |
| | 373 | (1) |
| | 374 | (4) |
| | 378 | (3) |
| CHAPTER 8 Object-Oriented Design | | | 381 | (66) |
| 8.1 Java Classes Revisited | | | 382 | (8) |
| 8.2 Modular Programming and Reuse | | | 390 | (5) |
| 8.3 Encapsulation, Inheritance, Visibility, and Packages | | | 395 | (10) |
| | 405 | (9) |
| 8.5 Another Look at Inheritance | | | 414 | (4) |
| 8.6 Class Members and Instance Members: static and final | | | 418 | (7) |
| | 425 | (14) |
| 8.8 Multiple Inheritance and Interfaces | | | 439 | (4) |
| 8.9 Common Programming Errors | | | 443 | (1) |
| | 443 | (1) |
| | 444 | (1) |
| Answers to Quick-Check Exercises | | | 445 | (1) |
| | 445 | (1) |
| | 446 | (1) |
| CHAPTER 9 Applets, Graphical User Interfaces, and Threads | | | 447 | (60) |
| 9.1 Web Programming and Client/Server Model | | | 448 | (7) |
| 9.2 Applets, Panels, Containers, Components | | | 455 | (7) |
| 9.3 The Basic Interactive Applet | | | 462 | (15) |
| 9.4 Introduction to Threads | | | 477 | (8) |
| 9.5 Threaded Animation (Optional) | | | 485 | (6) |
| 9.6 Browser/Applet Interaction | | | 491 | (9) |
| | 500 | (4) |
| | 504 | (1) |
| Answers to Quick-Check Exercises | | | 504 | (1) |
| | 505 | (1) |
| | 505 | (2) |
| CHAPTER 10 GUIs as a Vehicle for Object-Oriented Design | | | 507 | (80) |
| 10.1 Abstraction Layers for User Input/Output | | | 508 | (6) |
| 10.2 Output to the User--Label, Canvas, Fonts, and Layout Managers | | | 514 | (13) |
| 10.3 Discrete User Input: Buttons, Boxes, and Lists | | | 527 | (17) |
| 10.4 Continuous and Textual User Input | | | 544 | (10) |
| 10.5 Low-Level User Input | | | 554 | (6) |
| 10.6 Turn-Taking within the Event Model | | | 560 | (11) |
| 10.7 Applications and Applets: Menus | | | 571 | (7) |
| | 578 | (3) |
| | 581 | (1) |
| Answers to Quick-Check Exercises | | | 582 | (1) |
| | 582 | (1) |
| | 583 | (1) |
| Interview: Marc Andreessen | | | 584 | (3) |
| | 587 | (44) |
| | 588 | (4) |
| 11.2 Recursive Mathematical Methods | | | 592 | (3) |
| 11.3 Use of the Stack in Recursion | | | 595 | (4) |
| 11.4 Recursive Methods with Arrays, Vectors, and Strings | | | 599 | (9) |
| | 608 | (4) |
| 11.6 Solving Towers of Hanoi with Recursion | | | 612 | (7) |
| 11.7 A Recursive Program with a GUI | | | 619 | (8) |
| 11.8 Common Programming Errors | | | 627 | (1) |
| | 627 | (1) |
| | 628 | (1) |
| Answers to Quick-Check Exercises | | | 628 | (1) |
| | 628 | (1) |
| | 629 | (2) |
| CHAPTER 12 Linked Data Structures | | | 631 | (52) |
| | 632 | (7) |
| | 639 | (9) |
| | 648 | (6) |
| | 654 | (7) |
| 12.5 A Binary Search Tree Class | | | 661 | (10) |
| 12.6 Efficiency of a Binary Search Tree | | | 671 | (2) |
| 12.7 Common Programming Errors | | | 673 | (1) |
| | 674 | (1) |
| | 674 | (2) |
| Answers to Quick-Check Exercises | | | 676 | (1) |
| | 676 | (1) |
| | 677 | (3) |
| | 680 | (3) |
APPENDIXES | | 683 | (106) |
Appendix A Getting Started, Going Further | | 683 | (10) |
Appendix B Java Language Summary | | 693 | (20) |
Appendix C Classes for Program Abstraction | | 713 | (20) |
Appendix D AWT for Graphical User Interfaces | | 733 | (56) |
Answers to Self-Check Exercises | | 789 | (28) |
Index | | 817 | |