List of examples | | xi | (2) |
Preface | | xiii | (6) |
Chapter summary | | xix | (4) |
Review board | | xxiii | |
PART I Fundamentals | | 1 | (174) |
| | 3 | (12) |
| | 3 | (5) |
| | 8 | (2) |
| 1.3 The approach of this book | | | 10 | (3) |
| | 13 | (1) |
| | 13 | (2) |
| Chapter 2 Simple programs | | | 15 | (35) |
| | 15 | (4) |
| 2.2 Fundamentals of object-oriented programming | | | 19 | (7) |
| 2.3 Beginning with output | | | 26 | (4) |
| | 30 | (9) |
| 2.5 Using classes and objects | | | 39 | (5) |
| | 44 | (1) |
| | 45 | (1) |
| | 46 | (4) |
| | 50 | (37) |
| 3.1 On the structure of a program | | | 50 | (1) |
| | 51 | (6) |
| 3.3 Repetition with for-loops | | | 57 | (7) |
| | 64 | (9) |
| 3.5 Guidelines for designing classes | | | 73 | (6) |
| 3.6 Case study 1: Price tickets | | | 79 | (3) |
| | 82 | (1) |
| | 83 | (1) |
| | 84 | (3) |
| Chapter 4 Changing the state | | | 87 | (26) |
| 4.1 Inputting interactively | | | 87 | (2) |
| 4.2 Java Gently's Text class | | | 89 | (3) |
| 4.3 File input and output | | | 92 | (3) |
| 4.4 Selection with if-else | | | 95 | (8) |
| 4.5 Introduction to exceptions | | | 103 | (7) |
| | 110 | (1) |
| | 110 | (1) |
| | 111 | (2) |
| Chapter 5 Controlling the flow | | | 113 | (24) |
| 5.1 Conditional loops with while and do | | | 113 | (4) |
| | 117 | (5) |
| 5.3 Conditional loops and input data | | | 122 | (4) |
| 5.4 Case study 2: Rock-scissors-paper game | | | 126 | (6) |
| | 132 | (1) |
| | 132 | (1) |
| | 133 | (4) |
| Chapter 6 Arrays and tables | | | 137 | (38) |
| | 137 | (10) |
| 6.2 Multi-dimensional arrays | | | 147 | (9) |
| | 156 | (6) |
| | 162 | (3) |
| | 165 | (5) |
| | 170 | (1) |
| | 170 | (1) |
| | 171 | (4) |
PART II Power | | 175 | (192) |
| Chapter 7 Objects at work | | | 177 | (30) |
| 7.1 Designing an object-oriented program | | | 177 | (10) |
| 7.2 Properties of objects | | | 187 | (4) |
| | 191 | (5) |
| 7.4 Case study 3: Nelson's Coffee Shop | | | 196 | (8) |
| | 204 | (1) |
| | 205 | (1) |
| | 205 | (2) |
| Chapter 8 Abstraction and inheritance | | | 207 | (24) |
| | 207 | (2) |
| 8.2 Abstraction through interfaces | | | 209 | (6) |
| | 215 | (11) |
| 8.4 Abstract methods and classes | | | 226 | (1) |
| | 227 | (1) |
| | 227 | (1) |
| | 228 | (3) |
| Chapter 9 Graphical user interfaces | | | 231 | (28) |
| 9.1 Introduction to the awt | | | 231 | (2) |
| 9.2 Putting graphics in a window | | | 233 | (5) |
| 9.3 Laying out buttons and labels | | | 238 | (5) |
| 9.4 Panels and canvases for grouping | | | 243 | (4) |
| 9.5 Interaction with text fields | | | 247 | (3) |
| 9.6 Event-driven programming | | | 250 | (1) |
| 9.7 Case study 4: Supermarket till | | | 251 | (6) |
| | 257 | (1) |
| | 257 | (1) |
| | 258 | (1) |
| Chapter 10 Applets in action | | | 259 | (26) |
| 10.1 From applications to applets | | | 259 | (3) |
| | 262 | (8) |
| | 270 | (4) |
| 10.4 Case study 5: The Nature Conservation Project | | | 274 | (8) |
| | 282 | (1) |
| | 282 | (1) |
| | 283 | (2) |
| | 285 | (42) |
| | 285 | (6) |
| | 291 | (13) |
| 11.3 Synchronizing between threads | | | 304 | (9) |
| | 313 | (5) |
| 11.5 Case study 6: Chatter system | | | 318 | (5) |
| | 323 | (1) |
| | 324 | (1) |
| | 324 | (3) |
| Chapter 12 Algorithms and data Structures | | | 327 | (40) |
| 12.1 About data structures | | | 327 | (2) |
| 12.2 Linear and binary searching | | | 329 | (6) |
| 12.3 Quicksort and performance | | | 335 | (4) |
| | 339 | (9) |
| | 348 | (9) |
| | 357 | (6) |
| | 363 | (1) |
| | 363 | (1) |
| | 364 | (3) |
Answers to Quizzes | | 367 | (16) |
Index | | 383 | |