Preface Chapter 1 Introduction 1.1 Computer Processing Software Categories Digital Computers Binary Numbers 1.2 Hardware Components Computer Architecture Input/Output Devices Main Memory and Secondary Memory The Central Processing Unit 1.3 Networks Network Connections Local..Area Networks and Wide-Area Networks The Internet The W10rid Wide Wleb Uniform Resource Locators 1.4 The Java Programming Language A Java Program Comments Identifiers and Reserved Words White Space 1.5 Program Development Programming Language Levels Editors,Compilers,and Interpreters Development Environments Syntax and Semantics Errnrs 1.6 Object-Oriented Programming Problem Solving Object-Oriented Software Principles Chapter 2 Data and Expressions 2.1 Character Strings The print and println Methods String Concatenation Escape Sequences 。 2.2 Variables and Assignment Variables The Assignment Statement Constants 2.3 Primitive Data Types Integers and Floating Points Characters Booleans 2.4 Expressions Arithmetic Operators Operator Precedence Increment and Decrement Operators Assignment Operators 2.5 Data Conversion Conversion Techniques 2.6 Interactive Programs The Scanner Class 2.7 Graphics Coordinate Systems Representing Color 2.8 Applets Executing Applets Using the Web 2.9 Drawing Shapes The Graphics Class Chapter 3 Using Classes and Objects 3.1 Creating Objects Aliases 3.2 The String Class 3.3 Packages The import Declaration 3.4 The Random Class 3.5 The Math Class 3.6 Formatting Output The NumberFormat Class The DecimaIFormat Class The printf Method 3.7 Enumerated Types 3.8 Wrapper Classes Autoboxing 3.9 Components and Containers Frames and Panels 3.10 Nested Panels 3.11 Images Chapter 4 Writing Classes 4.1 Classes and Objects Revisited 4.2 Anatomy of a Class Instance Data UML Class Diagrams 4.3 Encapsulation Visibility Modifiers Accessors and Mutators 4.4 Anatomy of a Method The return Statement Parameters Local Data Bank Account Example 4.5 Constructors Revisited 4.6 Graphical Objects 4.7 Graphical User Interfaces 4.8 Buttons 4.9 Text Fields Chapter 5 Conditionals and Loops 5.1 Boolean Expressions Equality and Relational Operators Logical Operators 5.2 The i f Statement The if-else Statement Using Block Statements The Conditional Operator Nested if Statements 5.3 Comparing Data Comparing Floats Comparing Characters Comparing Objects 5.4 The switch Statement 5.5 The while Statement Infinite Loops Nested Loops Other Loop Controls 5.6 Iterators Reading Text Files 5.7 The do Statement 5.8 The for Statement herators and for Loops Comparing Loops 5.9 Drawing with Loops and Conditionals 5.10 Determining Event Sources 5.11 Dialog Boxes 5.12 More Button Components Check Boxes Radio Buttons Chapter 6 Object-Oriented Design 6.1 Software Development Activities 6.2 Identifying Classes and Objects Assigning Responsibilities 6.3 Static Class Members Static Variables Static Methods 6.4 Class Relationships Dependency Dependencies Among Objects of the Same Class Aggregation The this Reference 6.5 Interfaces The Comparable Interface The Iterator Interface 6.6 Enumerated Types Revisited 6.7 Method Design Method Decomposition Method Parameters Revisited 6.8 Method Overloading 6.9 Testing Reviews Defect Testing 6.10 GUI Design 6.11 Layout Managers Flow Layout Border Layout Grid Layout Box Layout 6.12 Borders 6.13 Containment Hierarchies Chapter 7 Arrays 7.1 Array Elements 7.2 Declaring and Using Arrays Bounds Checking Alternate Array Syntax Initializer Lists Arrays as Parameters 7.3 Arrays of Objects 7.4 Command-Line Arguments 7.5 Variable Length Parameter Lists 7.6 Two-DimensionaI Arrays Muhidimensional Arrays 7.7 The ArrayList Class 、 Specifying an ArrayList Element Type ArrayList Efficiency 7.8 Polygons and Polylines The Polygon Class 7.9 Mouse Events 7.10 Key Events Chapter 8 Inheritance 8.1 Creating Subclasses The protected Modifier The super Reference Multiple Inheritance 8.2 Overriding Methods Shadowing Variables 8.3 Class Hierarc hies The Obj ect Class Abstract Classes Interface Hierarchies 8.4 Visibility 8.5 Designing for Inheritance Restricting Inheritance 8.6 The Component Class Hierarchy 8.7 Extending Adapter CIasses 8.8 The Timer Class Chapter 9 Polymorphism 9.1 Late Binding 9.2 Polymorphism via Inheritance 9.3 Polymorphism via interfaces 9.4 Sorting Selection Sort Insertion Sort Comparing Sorts 9.5 Searching Linear Search Binary Search Comparing Searches 9.6 Designing for Polymorphism 9.7 Event Processing 9.8 File Choosers 9.9 Color Choosers 9.10 Sliders Chapter 10 Exceptions 10.1 Exception Handling 10.2 Uncaught Exceptions 10.3 The try-catch Statement The f inally Clause 10.4 Exception Propagation 10.5 The Exception Class Hierarchy Checked and Unchecked Exceptions 10.6 I/O Exceptions 10.7 Tool Tips and Mnemonics 10.8 Combo Boxes 10.9 ScrolI Panes 10.10 Split Panes Chapter 11 Recursion 11.1 Recursive Thinking Infinite Recursion Recursion in Math 11.2 Recursive Programming Recursion VS.Iteration Direct VS.Indirect Recursion 11.3 Using Recursion Traversing a Maze The Towers of Hanoi 11.4 Recursion in Graphics Tiled Pictures Fractals Chapter 12 Collections 12.1 Collections and Data Structures Separating Interface from Implementation 12.2 Dynamic RepresentatiOns Dynamic btructures A Dynamically Linked List Other Dynamic List Representations 12.3 Linear Data Structures queues Stacks 12.4 Non-Linear Data Structures Trees Graphs 12.5 The Java Collections API Generics Appendix A Glossary Appendix B Number Systems Appendix C The Unicode Character Set Appendix D Java Operators Appendix E Java Modifiers Appendix F Java Coding Guidelines Appendix G Java Applets Appendix H Regular Expressions Appendix I JavaDoc Documentation Generator Appendix J The PaintBox Project Appendix K GUI Events Appendix L Java Syntax Appendix M The Java Class Library Index