Chapter 1: An Introduction to Java
1.1 Java as a Programming Platform
1.2 The Java “White Paper” Buzzwords
1.3 Java Applets and the Internet
1.5 Common Misconceptions about Java
Chapter 2: The Java Programming Environment
2.1 Installing the Java Development Kit
2.1.3 Installing Source Files and Documentation
2.2 Using the Command-Line Tools
2.3 Using an Integrated Development Environment
2.4 Running a Graphical Application
2.5 Building and Running Applets
Chapter 3: Fundamental Programming Structures in Java
3.3.4 Unicode and the char Type
3.5.1 Mathematical Functions and Constants
3.5.2 Conversions between Numeric Types
3.5.4 Combining Assignment with Operators
3.5.5 Increment and Decrement Operators
3.5.6 Relational and boolean Operators
3.5.8 Parentheses and Operator Hierarchy
3.6.4 Testing Strings for Equality
3.6.6 Code Points and Code Units
3.6.8 Reading the Online API Documentation
3.8.5 Multiple Selections—The switch Statement
3.8.6 Statements That Break Control Flow
3.10.2 Array Initializers and Anonymous Arrays
3.10.4 Command-Line Parameters
3.10.6 Multidimensional Arrays
Chapter 4: Objects and Classes
4.1 Introduction to Object-Oriented Programming
4.1.4 Relationships between Classes
4.2.1 Objects and Object Variables
4.2.2 The LocalDate Class of the Java Library
4.2.3 Mutator and Accessor Methods
4.3.2 Use of Multiple Source Files
4.3.3 Dissecting the Employee Class
4.3.4 First Steps with Constructors
4.3.5 Implicit and Explicit Parameters
4.3.6 Benefits of Encapsulation
4.3.7 Class-Based Access Privileges
4.6.2 Default Field Initialization
4.6.3 The Constructor with No Arguments
4.6.4 Explicit Field Initialization
4.6.6 Calling Another Constructor
4.6.8 Object Destruction and the finalize Method
4.7.3 Addition of a Class into a Package
4.9.6 Package and Overview Comments
5.1 Classes, Superclasses, and Subclasses
5.1.6 Understanding Method Calls
5.1.7 Preventing Inheritance: Final Classes and Methods
5.2 Object: The Cosmic Superclass
5.2.2 Equality Testing and Inheritance
5.3.1 Accessing Array List Elements
5.3.2 Compatibility between Typed and Raw Array Lists
5.4 Object Wrappers and Autoboxing
5.5 Methods with a Variable Number of Parameters
5.7.2 A Primer on Catching Exceptions
5.7.3 Using Reflection to Analyze the Capabilities of Classes
5.7.4 Using Reflection to Analyze Objects at Runtime
5.7.5 Using Reflection to Write Generic Array Code
5.7.6 Invoking Arbitrary Methods
5.8 Design Hints for Inheritance
Chapter 6: Interfaces, Lambda Expressions, and Inner Classes
6.1.2 Properties of Interfaces
6.1.3 Interfaces and Abstract Classes
6.1.6 Resolving Default Method Conflicts
6.2.1 Interfaces and Callbacks
6.2.2 The Comparator Interface
6.3.2 The Syntax of Lambda Expressions
6.3.7 Processing Lambda Expressions
6.4.1 Use of an Inner Class to Access Object State
6.4.2 Special Syntax Rules for Inner Classes
6.4.3 Are Inner Classes Useful? Actually Necessary? Secure?
6.4.5 Accessing Variables from Outer Methods
6.5.3 Properties of Proxy Classes
Chapter 7: Exceptions, Assertions, and Logging
7.1.1 The Classification of Exceptions
7.1.2 Declaring Checked Exceptions
7.1.3 How to Throw an Exception
7.1.4 Creating Exception Classes
7.2.2 Catching Multiple Exceptions
7.2.3 Rethrowing and Chaining Exceptions
7.2.5 The Try-with-Resources Statement
7.2.6 Analyzing Stack Trace Elements
7.4.2 Assertion Enabling and Disabling
7.4.3 Using Assertions for Parameter Checking
7.4.4 Using Assertions for Documenting Assumptions
7.5.3 Changing the Log Manager Configuration
Chapter 8: Generic Programming
8.1.1 The Advantage of Type Parameters
8.1.2 Who Wants to Be a Generic Programmer?
8.2 Defining a Simple Generic Class
8.5 Generic Code and the Virtual Machine
8.5.2 Translating Generic Expressions
8.5.3 Translating Generic Methods
8.6 Restrictions and Limitations
8.6.1 Type Parameters Cannot Be Instantiated with Primitive Types
8.6.2 Runtime Type Inquiry Only Works with Raw Types
8.6.3 You Cannot Create Arrays of Parameterized Types
8.6.5 You Cannot Instantiate Type Variables
8.6.6 You Cannot Construct a Generic Array
8.6.7 Type Variables Are Not Valid in Static Contexts of Generic Classes
8.6.8 You Cannot Throw or Catch Instances of a Generic Class
8.6.9 You Can Defeat Checked Exception Checking
8.6.10 Beware of Clashes after Erasure
8.7 Inheritance Rules for Generic Types
8.8.2 Supertype Bounds for Wildcards
8.9.2 Using Class<T> Parameters for Type Matching
8.9.3 Generic Type Information in the Virtual Machine
9.1 The Java Collections Framework
9.1.1 Separating Collection Interfaces and Implementation
9.1.2 The Collection Interface
9.1.5 Interfaces in the Collections Framework
9.3.5 Linked Hash Sets and Maps
9.3.6 Enumeration Sets and Maps
9.4.1 Lightweight Collection Wrappers
9.4.6 A Note on Optional Operations
9.5.5 Converting between Collections and Arrays
9.5.6 Writing Your Own Algorithms
Chapter 10: Graphics Programming
10.3.2 Determining a Good Frame Size
10.4 Displaying Information in a Component
10.7 Using Special Fonts for Text
11.1.1 Example: Handling a Button Click
11.1.2 Specifying Listeners Concisely
11.1.3 Example: Changing the Look-and-Feel
11.4.1 Semantic and Low-Level Events
Chapter 12: User Interface Components with Swing
12.1 Swing and the Model-View-Controller Design Pattern
12.1.2 The Model-View-Controller Pattern
12.1.3 A Model-View-Controller Analysis of Swing Buttons
12.2 Introduction to Layout Management
12.3.2 Labels and Labeling Components
12.5.3 Checkbox and Radio Button Menu Items
12.5.5 Keyboard Mnemonics and Accelerators
12.5.6 Enabling and Disabling Menu Items
12.6 Sophisticated Layout Management
12.6.1.1 The gridx, gridy, gridwidth, and gridheight Parameters
12.6.1.3 The fill and anchor Parameters
12.6.1.5 Alternative Method to Specify the gridx, gridy, gridwidth, and gridheight Parameters
12.6.1.6 A Helper Class to Tame the Grid Bag Constraints
12.6.3 Using No Layout Manager
12.8 Troubleshooting GUI Programs
12.8.2 Letting the AWT Robot Do the Work
Chapter 13: Deploying Java Applications
13.2 Storage of Application Preferences
13.4.2 The applet HTML Tag and Its Attributes
13.4.3 Use of Parameters to Pass Information to Applets
13.4.4 Accessing Image and Audio Files
13.4.6 Inter-Applet Communication
13.4.7 Displaying Items in the Browser
13.5.1 Delivering a Java Web Start Application
14.1.1 Using Threads to Give Other Tasks a Chance
14.3.3 Blocked and Waiting Threads
14.4.3 Handlers for Uncaught Exceptions
14.5.1 An Example of a Race Condition
14.5.2 The Race Condition Explained
14.5.5 The synchronized Keyword
14.5.12 Thread-Local Variables
14.5.13 Lock Testing and Timeouts
14.5.15 Why the stop and suspend Methods Are Deprecated
14.7.1 Efficient Maps, Sets, and Queues
14.7.2 Atomic Update of Map Entries
14.7.3 Bulk Operations on Concurrent Hash Maps
14.7.6 Parallel Array Algorithms
14.7.7 Older Thread-Safe Collections
14.9.3 Controlling Groups of Tasks
14.9.4 The Fork-Join Framework
14.11.1 Running Time-Consuming Tasks
14.11.2 Using the Swing Worker