| Contents |
| | Writing the Third Edition |
| | About This Book |
| | Using the Book |
| | Book Web Sites |
| | Request for Feedback |
| | About the Authors |
| | Acknowledgments (First Edition) |
| | Acknowledgments (Second Edition) |
| | Acknowledgments (Third Edition) |
1 | Basics of Java Programming |
| 1.1 | Introduction |
| 1.2 | Classes |
| 1.3 | Objects |
| 1.4 | Instance Members |
| 1.5 | Static Members |
| 1.6 | Inheritance |
| 1.7 | Aggregation |
| 1.8 | Tenets of Java |
| 1.9 | Java Programs |
| 1.10 | Sample Java Application |
2 | Language Fundamentals |
| 2.1 | Basic Language Elements |
| 2.2 | Primitive Data Types |
| 2.3 | Variable Declarations |
| 2.4 | Initial Values for Variables |
3 | Declarations |
| 3.1 | Class Declarations |
| 3.2 | JavaBeans Standard |
| 3.3 | Method Declarations |
| 3.4 | Constructors |
| 3.5 | Enumerated Types |
| 3.6 | Arrays |
| 3.7 | Parameter Passing |
| 3.8 | Variable Arity Methods |
| 3.9 | The main() Method |
4 | Access Control |
| 4.1 | Java Source File Structure |
| 4.2 | Packages |
| 4.3 | Searching for Classes |
| 4.4 | The JAR Utility |
| 4.5 | System Properties |
| 4.6 | Scope Rules |
| 4.7 | Accessibility Modifiers for Top-level Type Declarations |
| 4.8 | Other Modifiers for Classes |
| 4.9 | Member Accessibility Modifiers |
| 4.10 | Other Modifiers for Members |
5 | Operators and Expressions |
| 5.1 | Conversions |
| 5.2 | Type Conversion Contexts |
| 5.3 | Precedence and Associativity Rules for Operators |
| 5.4 | Evaluation Order of Operands |
| 5.5 | The Simple Assignment Operator = |
| 5.6 | Arithmetic Operators: * , / , % , + , - |
| 5.7 | The Binary String Concatenation Operator + |
| 5.8 | Variable Increment and Decrement Operators: ++ , -- |
| 5.9 | Boolean Expressions |
| 5.10 | Relational Operators: < , <= , > , >= |
| 5.11 | Equality |
| 5.12 | Boolean Logical Operators: ! , ^ , & , | |
| 5.13 | Conditional Operators: && , || |
| 5.14 | The Conditional Operator: ? |
| 5.15 | Other Operators: new , [] , instanceof |
6 | Control Flow |
| 6.1 | Overview of Control Flow Statements |
| 6.2 | Selection Statements |
| 6.3 | Iteration Statements |
| 6.4 | Transfer Statements |
| 6.5 | Stack-based Execution and Exception Propagation |
| 6.6 | Exception Types |
| 6.7 | Exception Handling: try , catch , and finally |
| 6.8 | The throw Statement |
| 6.9 | The throws Clause |
| 6.10 | Assertions |
7 | Object-oriented Programming |
| 7.1 | Single Implementation Inheritance |
| 7.2 | Overriding Methods |
| 7.3 | Hiding Members |
| 7.4 | The Object Reference super |
| 7.5 | Chaining Constructors Using this() and super() |
| 7.6 | Interfaces |
| 7.7 | Arrays and Subtyping |
| 7.8 | Reference Values and Conversions |
| 7.9 | Reference Value Assignment Conversions |
| 7.10 | Method Invocation Conversions Involving References |
| 7.11 | Reference Casting and the instanceof Operator |
| 7.12 | Polymorphism and Dynamic Method Lookup |
| 7.13 | Inheritance vs. Aggregation |
| 7.14 | Basic Concepts in Object-Oriented Design |
8 | Nested Type Declarations |
| 8.1 | Overview of Nested Type Declarations |
| 8.2 | Static Member Types |
| 8.3 | Non-static Member Classes |
| 8.4 | Local Classes |
| 8.5 | Anonymous Classes |
9 | Object Lifetime |
| 9.1 | Garbage Collection |
| 9.2 | Reachable Objects |
| 9.3 | Facilitating Garbage Collection |
| 9.4 | Object Finalization |
| 9.5 | Finalizer Chaining |
| 9.6 | Invoking Garbage Collection Programmatically |
| 9.7 | Initializers |
| 9.8 | Field Initializer Expressions |
| 9.9 | Static Initializer Blocks |
| 9.10 | Instance Initializer Blocks |
| 9.11 | Constructing Initial Object State |
10 | Fundamental Classes |
| 10.1 | Overview of the java.lang Package |
| 10.2 | The Object Class |
| 10.3 | The Wrapper Classes |
| 10.4 | The String Class |
| 10.5 | The StringBuilder and the StringBuffer Classes |
11 | Files and Streams |
| 11.1 | Input and Output |
| 11.2 | The File Class |
| 11.3 | Byte Streams: Input Streams and Output Streams |
| 11.4 | Character Streams: Readers and Writers |
| 11.5 | The Console class |
| 11.6 | Object Serialization |
12 | Localization, Pattern Matching and Formatting |
| 12.1 | The java.util.Locale Class |
| 12.2 | The java.util.Date Class |
| 12.3 | The java.util.Calendar Class |
| 12.4 | The java.text.DateFormat Class |
| 12.5 | The java.text.NumberFormat Class |
| 12.6 | String Pattern Matching using Regular Expressions |
| 12.7 | Formatting Values |
13 | Threads |
| 13.1 | Multitasking |
| 13.2 | Overview of Threads |
| 13.3 | The Main Thread |
| 13.4 | Thread Creation |
| 13.5 | Synchronization |
| 13.6 | Thread Transitions |
14 | Generics |
| 14.1 | Introducing Generics |
| 14.2 | Generic Types and Parameterized Types |
| 14.3 | Collections and Generics |
| 14.4 | Wildcards |
| 14.5 | Using References of Wildcard Parameterized Types |
| 14.6 | Bounded Type Parameters |
| 14.7 | Implementing a Simplified Generic Stack |
| 14.8 | Generic Methods and Constructors |
| 14.9 | Wildcard Capture |
| 14.10 | Flexibility with Wildcard Parameterized Types |
| 14.11 | Type Erasure |
| 14.12 | Implications for Overloading and Overriding |
| 14.13 | Limitations and Restrictions on Generic Types |
15 | Collections and Maps |
| 15.1 | Comparing Objects |
| 15.2 | The Java Collections Framework |
| 15.3 | Collections |
| 15.4 | Sets |
| 15.5 | The SortedSet<E> and NavigableSet<E> Interfaces |
| 15.6 | Lists |
| 15.7 | Queues |
| 15.8 | Maps |
| 15.9 | Map Implementations |
| 15.10 | The SortedMap<K,V> and NavigableMap<K,V> Interfaces |
| 15.11 | Working with Collections |
A | Taking the SCJP 1.6 Exam |
| A.1 | Preparing for the Programmer Exam |
| A.2 | Registering for the Exam |
| A.3 | How the Examination Is Conducted |
| A.4 | The Questions |
| A.5 | Moving on to other Java Technology Exams |
B | Objectives for the SCJP 1.6 Exam |
C | Objectives for the SCJP 1.6 Upgrade Exam |
D | Annotated Answers to Review Questions |
E | Solutions to Programming Exercises |
F | Mock Exam |
G | Number Systems and Number Representation |
| G.1 | Number Systems |
| G.2 | Relationship between Binary, Octal, and Hexadecimal Numbers |
| G.3 | Converting Decimals |
| G.4 | Representing Integers |
| Index |