Contents at a Glance
Introduction .................................... 1
Book I: Getting Started with Java Basics ........ 5
Chapter 1: Welcome to Java .....................7
Chapter 2: Installing and Using Java Tools ........19
Chapter 3: Working with TextPad ...................33
Book II: Programming Basics ............ 41
Chapter 1: Java Programming Basics ...................43
Chapter 2: Working with Variables and Data Types ..............61
Chapter 3: Working with Numbers and Expressions ...........95
Chapter 4: Making Choices .........................123
Chapter 5: Going Around in Circles (Or, Using Loops) .......143
Chapter 6: Pulling a Switcheroo ............................169
Chapter 7: Adding Some Methods to Your Madness .............181
Chapter 8: Handling Exceptions ..........................201
Book III: Object-Oriented Programming ..................... 221
Chapter 1: Understanding Object-Oriented Programming .....223
Chapter 2: Making Your Own Classes ...............235
Chapter 3: Working with Statics ..................253
Chapter 4: Using Subclasses and Inheritance ......261
Chapter 5: Using Abstract Classes and Interfaces .........281
Chapter 6: Using the Object and Class Classes ............297
Chapter 7: Using Inner Classes, Anonymous Classes, and Lambda Expressions .......\....321
Chapter 8: Packaging and Documenting Your Classes ...........333
Book IV: Strings, Arrays, and Collections .................. 349
Chapter 1: Working with Strings ..............351
Chapter 2: Using Arrays ................369
Chapter 3: Using the ArrayList Class........395
Chapter 4: Using the LinkedList Class ............409
Chapter 5: Creating Generic Collection Classes ..........421
Chapter 6: Using Bulk Data Operations with Collections ......435
Book V: Programming Techniques ............................. 445
Chapter 1: Programming Threads ..................447
Chapter 2: Network Programming ..................475
Chapter 3: Using Regular Expressions ............499
Chapter 4: Using Recursion ......................515
Chapter 5: Working with Dates and Times ........529
Chapter 6: Using BigDecimals ....................549
Book VI: Swing ................ 567
Chapter 1: Swinging into Swing .........569
Chapter 2: Handling Events .............583
Chapter 3: Getting Input from the User.........601
Chapter 4: Choosing from a List ...............629
Chapter 5: Using Layout Managers ..............651
Book VII: Web Programming .................... 673
Chapter 1: Creating Applets ...................675
Chapter 2: Creating Servlets ..................683
Chapter 3: Using JavaServer Pages .............703
Book VIII: Files and Databases ............... 717
Chapter 1: Working with Files .................719
Chapter 2: Working with File Streams ..........741
Chapter 3: Database for $100, Please ..........767
Chapter 4: Using JDBC to Connect to a Database ........783
Chapter 5: Working with XML ................797
Book IX: Fun and Games .................... 815
Chapter 1: Fun with Fonts and Colors .......817
Chapter 2: Drawing Shapes ...............831
Chapter 3: Using Images and Sound .......855
Chapter 4: Animation and Game Programming ........869
Index ........................... 887