Table Of Contents
Chapter 1: Introduction to Computers and Java 1.1 Introduction 1.2 Why Program? 1.3 Computer Systems: Hardware and Software 1.4 Programming Languages 1.5 What is a Program Made Of? 1.6 Object-Oriented Programming 1.7 The Programming Process Review Questions, and Exercises Chapter 2: Java Fundamentals 2.1 The Parts of a Java Program 2.2 The print and println Methods, and the Java Standard Class Library 2.3 Variables and Literals 2.4 Primitive Data Types 2.5 Arithmetic Operators 2.6 Conversion Between Primitive Types 2.7 Combined Assignment Operators 2.8 Creating Named Constants with final 2.9 The String Class 2.10 Scope 2.11 Comments 2.12 Programming Style 2.13 Using the Scanner Class to Read Keyboard Input 2.14 Dialog Boxes 2.15 Common Errors to Avoid Review Questions, and Exercises Chapter 3: A First Look at Classes and Objects 3.1 Classes 3.2 More About Passing Arguments 3.3 Instance Fields and Methods 3.4 Constructors 3.5 A BankAccount Class 3.6 Classes, Variables, and Scope 3.7 Packages and import Statements 3.8 Focus On Object-Oriented Design: Finding the Classes and Their Responsibilities 3.9 Common Errors to Avoid Review Questions, and Exercises Chapter 4: Decision Structures 4.1 The if Statement 4.2 The if-else Statement 4.3 The Payroll Class 4.4 The if-else-if Statement 4.5 Nested if Statements 4.6 Logical Operators 4.7 Comparing String Objects 4.8 More About Variable Declaration and Scope 4.9 The Conditional Operator (Optional) 4.10 The switch Statement 4.11 Formatting Numbers with the DecimalFormat Class 4.12 Focus on Problem Solving: The SalesCommission Class 4.13 The Random Class 4.14 Common Errors to Avoid Review Questions and Exercises Chapter 5: Loops and Files 5.1 The Increment and Decrement Operators 5.2 The while Loop 5.3 Using the while Loop for Input Validation 5.4 The do-while loop 5.5 The for Loop 5.6 Running Totals and Sentinel Values 5.7 Nested Loops 5.8 The break and continue Statements 5.9 Deciding Which Loop to Use 5.10 Introduction to File Input and Output 5.11 Common Errors to Avoid Review Questions and Exercises Case Study on CD-ROM: The Amortization Class Chapter 6: A Second Look at Classes and Objects 6.1 Static Class Members 6.2 Overloaded Methods 6.3 Overloaded Constructors 6.4 Passing Objects as Arguments to Methods 6.5 Returning Objects from Methods 6.6 The toString method 6.7 Writing an equals Method 6.8 Methods that Copy Objects 6.9 Aggregation 6.10 The this Reference Variable 6.11 Inner Classes 6.12 Enumerated Types 6.13 Garbage Collection 6.14 Focus on Object-Oriented Design: Class Collaboration 6.15 Common Errors to Avoid Review Questions, and Exercises Bonus Section on CD-ROM: More about the Math Class Chapter 7: Arrays 7.1 Introduction to Arrays 7.2 Processing Array Contents 7.3 Passing Arrays as Arguments 7.4 Some Useful Array Algorithms and Operations 7.5 Returning Arrays from Methods 7.6 String Arrays 7.7 Arrays of Objects 7.8 The Sequential Search Algorithm 7.9 The Selection Sort and Binary Search Algorithms 7.10 Two-Dimensional Arrays 7.11 Arrays with Three or More Dimensions 7.12 Command-Line Arguments and Variable-Length Argument Lists 7.13 The Vector Class 7.14 Common Errors to Avoid Review Questions and Exercises Case Study on CD-ROM: The PinTester Class Case Study on CD-ROM: Parallel Arrays Chapter 8: Text Processing and Wrapper Classes 8.1 Introduction to Wrapper Classes 8.2 Character Testing and Conversion with the Character Class 8.3 More About String Objects 8.4 The StringBuffer Class 8.5 Tokenizing Strings 8.6 Wrapper Classes for the Numeric Data Types 8.7 Common Errors to Avoid Review Questions, and Exercises Case Study on CD-ROM: The SerialNumber Class Chapter 9: Inheritance 9.1 What is Inheritance? 9.2 Calling the Superclass Constructor 9.3 Overriding Superclass Methods 9.4 Protected Members 9.5 Classes that Inherit from Subclasses 9.6 The Object Class 9.7 Polymorphism 9.8 Abstract Classes and Abstract Methods 9.9 Interfaces 9.10 Common Errors to Avoid Review Questions and Exercises Chapter 10: Exceptions and Stream I/O 10.1 Handling Exceptions 10.2 Throwing Exceptions 10.3 More About Input/Output Streams 10.4 Advanced Topics: Binary Files, Random Access Files, and Object Serialization 10.5 Common Errors to Avoid Review Questions and Exercises Bonus Section on CD-ROM: Working with Records and Random-Access Files Chapter 11: GUI Applications, Part 1 11.1 Introduction 11.2 Dialog Boxes 11.3 Creating Windows 11.4 Equipping GUI Classes with a main Method 11.5 Layout Managers 11.6 Radio Buttons and Check Boxes 11.7 Borders 11.8 Focus on Problem Solving: Extending the JPanel Class 11.9 Using Console Output to Debug a GUI Application 11.10 Common Errors to Avoid Review Questions and Exercises Chapter 12: GUI Applications, Part 2 12.1 Read-Only Text Fields 12.2 Lists 12.3 Combo Boxes 12.4 Displaying Images in Labels and Buttons 12.5 Mnemonics and Tool Tips 12.6 File Choosers and Color Choosers 12.7 Menus 12.8 More about Text Components: Text Areas and Fonts 12.9 Sliders 12.10 Look and Feel 12.11 Common Errors to Avoid Review Questions and Exercises Case Study on CD-ROM: A Simple Text Editor Application Chapter 13: Applets 13.1 Introduction to Applets 13.2 A Brief Introduction to HTML 13.3 Creating Applets with Swing 13.4 Using AWT for Portability 13.5 Drawing Shapes 13.6 Handling Mouse Events 13.7 Timer Objects 13.8 Common Errors to Avoid Review Questions and Exercises Chapter 14: Recursion 14.1 Introduction to Recursion 14.2 Solving Problems with Recursion 14.3 Examples of Recursive Methods 14.4 A Recursive Binary Search Method 14.5 The Towers of Hanoi 14.6 Common Errors to Avoid Review Questions and Exercises Bonus Section on CD-ROM: The QuickSort Algorithm Appendix A: The ASCII and Unicode Characters Appendix B: Operator Precedence Table Appendix C: Java Key Words Appendix D: Installing the JDK and JDK Documentation Appendix E: Introduction to the javadoc Utility Appendix F: More About the Math Class Appendix G: Packages Appendix H: Working with Records and Random Access Files Appendix I: The QuickSort Algorithm Appendix J: Using JBuilder 8 Appendix K: Answers to Checkpoints Appendix L: Answers to Odd Numbered Review Questions |