Table of Contents
Preface.
1.
A Quick Tour.
1.1 Getting Started
1.2 Variables
1.3 Comments in Code
1.4 Named Constants
1.5 Unicode Characters
1.6 Flow of Control
1.7 Classes and Objects
1.8 Methods and Parameters
1.9 Arrays
1.10 String Objects
1.11 Extending a Class
1.12 Interfaces
1.13 Generic Types
1.14 Exceptions
1.15 Annotations
1.16 Packages
1.17 The Java Platform
1.18 Other Topics Briefly Noted
2.
Classes and Objects.
2.1 A Simple Class
2.2 Fields
2.3 Access Control
2.4 Creating Objects
2.5 Construction and Initialization
2.6 Methods
2.7 this
2.8 Overloading Methods
2.9 Importing Static Member Names
2.10 The main Method
2.11 Native Methods
3.
Extending Classes.
3.1 An Extended Class
3.2 Constructors in Extended Classes
3.3 Inheriting and Redefining Members
3.4 Type Compatibility and Conversion
3.5 What protected Really Means
3.6 Marking Methods and Classes Final
3.7 Abstract Classes and Methods
3.8 The Object Class
3.9 Cloning Objects
3.10 Extending Classes: How and When
3.11 Designing a Class to Be Extended
3.12 Single Inheritance versus Multiple Inheritance
4.
Interfaces.
4.1 A Simple Interface Example
4.2 Interface Declarations
4.3 Extending Interfaces
4.4 Working with Interfaces
4.5 Marker Interfaces
4.6 When to Use Interfaces
5.
Nested Classes and Interfaces.
5.1 Static Nested Types
5.2 Inner Classes
5.3 Local Inner Classes
5.4 Anonymous Inner Classes
5.5 Inheriting Nested Types
5.6 Nesting in Interfaces
5.7 Implementation of Nested Types
6.
Enumeration Types.
6.1 A Simple Enum Example
6.2 Enum Declarations
6.3 Enum Constant Declarations
6.4 java.lang.Enum
6.5 To Enum or Not
7.
Tokens, Values and Variables.
7.1 Lexical Elements
7.2 Types and Literals
7.3 Variables
7.4 Array Variables
7.5 The Meanings of Names
8.
Primitives as Types.
8.1 Common Fields and Methods
8.2 Void
8.3 Boolean
8.4 Number
8.5 Character
8.6 Boxing Conversions
9.
Operators, and Expressions.
9.1 Arithmetic Operations
9.2 General Operators
9.3 Expressions
9.4 Type Conversions
9.5 Member Access
9.6 Operator Precedence and Associativity
10.
Control Flow.
10.1 Statements and Blocks
10.2 if-else
10.3 switch
10.4 while and do-while
10.5 for
10.6 Labels
10.7 break
10.8 continue
10.9 return
10.10 What, No goto?
11.
Generic Types.
11.1 Generic Type Declarations
11.2 Working with Generic Types
11.3 Generic Methods and Constructors
11.4 Wildcard Capture
11.5 Under the Hood: Erasure and Raw Types
11.6 Finding the Right Method--Revisited
11.7 Class Extension and Generic Types
12.
Exceptions and Assertions.
12.1 Creating Exception Types
12.2 throw
12.3 The throws Clause
12.4 try, catch, and finally
12.5 Exception Chaining
12.6 Stack Traces
12.7 When to Use Exceptions
12.8 Assertions
12.9 When to Use Assertions
12.10 Turning Assertions On and Off
13.
Strings and Regular Expressions.
13.1 Character Sequences
13.2 The String Class
13.3 Regular Expression Matching
13.4 The StringBuilder Class
13.5 Working With UTF-16
14.
Threads.
14.1 Creating Threads
14.2 Using Runnable
14.3 Synchronization
14.4 wait, notifyAll, and notify
14.5 Details of Waiting and Notification
14.6 Thread Scheduling
14.7 Deadlocks
14.8 Ending Thread Execution
14.9 Ending Application Execution
14.10 The Memory Model: Synchronization and Volatile
14.11 Thread Management, Security and ThreadGroup
14.12 Threads and Exceptions
14.13 ThreadLocal Variables
14.14 Debugging Threads
15.
Annotations.
15.1 A Simple Annotation Example
15.2 Annotation Types
15.3 Annotating Elements
15.4 Restricting Annotation Applicability
15.5 Retention Policies
15.6 Working with Annotations
16.
Reflection.
16.1 The Class class
16.2 Annotation Queries
16.3 The Modifier Class
16.4 The Member classes
16.5 Access Checking and AccessibleObject
16.6 The Field Class
16.7 The Method Class
16.8 Creating New Objects and the Constructor Class
16.9 Generic Type Inspection
16.10 Arrays
16.11 Packages
16.12 The Proxy Class
16.13 Loading Classes
16.14 Controlling Assertions at Runtime
17.
Garbage Collection and Memory.
17.1 Garbage Collection
17.2 A Simple Model
17.3 Finalization
17.4 Interacting with the Garbage Collector
17.5 Reachability States and Reference Objects
18.
Packages.
18.1 Package Naming
18.2 Type Imports
18.3 Package Access
18.4 Package Contents
18.5 Package Annotations
18.6 Package Objects and Specifications
19.
Documentation Comments.
19.1 The Anatomy of a Doc Comment
19.2 Tags
19.3 Inheriting Method Documentation Comments
19.4 A Simple Example
19.5 External Conventions
19.6 Notes on Usage
20.
The I/O Package.
20.1 Streams Overview
20.2 Byte Streams
20.3 Character Streams
20.4 InputStreamReader and OutputStreamWriter
20.5 A Quick Tour of The Stream Classes
20.6 The Data Byte Streams
20.7 Working with Files
20.8 Object Serialization
20.9 The IOException Classes
20.10 A Taste of New I/O
21.
Collections.
21.1 Collections
21.2 Iteration
21.3 Ordering using Comparable and Comparator
21.4 The Collection Interface
21.5 Set and SortedSet
21.6 List
21.7 Queue
21.8 Map and SortedMap
21.9 enum Collections
21.10 Wrapped Collections and the Collections Class
21.11 Synchronized Wrappers and Concurrent Collections
21.12 The Arrays Utility Class
21.13 Writing Iterator Implementations
21.14 Writing Collection Implementations
21.15 The Legacy Collection Types
21.16 Properties
22.
Miscellaneous Utilities.
22.1 Formatter
22.2 BitSet
22.3 Observer/Observable
22.4 Random
22.5 Scanner
22.6 StringTokenizer
22.7 Timer and TimerTask
22.8 UUID
22.9 Math and StrictMath
23.
System Programming.
23.1 The System Class
23.2 Creating Processes
23.3 Shutdown
23.4 The Rest of the Runtime
23.5 Security
24.
Internationalization and Localization.
24.1 Locale
24.2 Resource Bundles
24.3 Currency
24.4 Time, Dates, and Calendars
24.5 Formatting and Parsing Dates and Times
24.6 Internationalization and Localization for Text
25.
Standard Packages.
25.1 java.awt--The Abstract Window Toolkit
25.2 java.applet--Applets
25.3 java.beans--Components
25.4 java.math--Mathematics
25.5 java.net--The Network
25.6 java.rmi--Remote Method Invocation
25.7 java.security and Related Packages-- Security Tools
25.8 java.sql -- Relational Database Access
25.9 Utility Subpackages
25.10 javax. -- Standard Extensions
25.11 javax.accessibility -- Accessibility for GUIs
25.12 javax.naming--Directory and Naming Services
25.13 javax.sound--Sound Manipulation
25.14 javax.swing -- Swing GUI Components
25.15 org.omg.CORBA -- CORBA APIs
Appendix
A. Application Evolution.
A.1 Language, Library and Virtual Machine Versions
A.2 Dealing with Multiple Dialects
A.3 Generics: Reification, Erasure and Raw Types
Appendix
B. Useful Tables.
Further
Reading.
Index.