| 1: Introduction to Objects |
| 2: Everything is an Object |
| 3: Controlling Program Flow |
| 4: Initialization & Cleanup |
| 5: Hiding the Implementation |
| 8: Interfaces & Inner Classes |
| 9: Error Handling with Exceptions |
| 11: Collections of Objects |
| 14: Creating Windows & Applets |
| A: Passing & Returning Objects |
| B: Java Programming Guidelines |
| Preface to the 3rd edition |
| 1: Introduction to Objects |
| The progress of abstraction |
| An object has an interface |
| An object provides services |
| The hidden implementation |
| Reusing the implementation |
| Inheritance: reusing the interface |
| Is-a vs. is-like-a relationships |
| Interchangeable objects with polymorphism |
| Abstract base classes and interfaces |
| Object creation, use & lifetimes |
| Exception handling: dealing with errors |
| 2: Everything is an Object |
| You manipulate objects with references |
| You must create all the objects |
| You never need to destroy an object |
| Creating new data types: class |
| Default values for primitive members |
| Methods, arguments, and return values |
| Comments and embedded documentation |
| 3: Controlling Program Flow |
| 4: Initialization & Cleanup |
| Guaranteed initialization with the constructor |
| Cleanup: finalization and garbage collection |
| 5: Hiding the Implementation |
| package: the library unit |
| Interface and implementation |
| Initializing the base class |
| Constructors with arguments |
| Catching base constructor exceptions |
| Combining composition and inheritance |
| Guaranteeing proper cleanup |
| Choosing composition vs. inheritance |
| Composition vs. inheritance revisited |
| Initialization and class loading |
| Initialization with inheritance |
| Forgetting the object type |
| Abstract classes and methods |
| Constructors and polymorphism |
| Designing with inheritance |
| Pure inheritance vs. extension |
| Downcasting and run-time type identification |
| 8: Interfaces & Inner Classes |
| Inner classes & control frameworks |
| 9: Error Handling with Exceptions |
| Termination vs. resumption |
| Creating your own exceptions |
| The exception specification |
| The special case of RuntimeException |
| Performing cleanup with finally |
| Pitfall: the lost exception |
| Reflection: run time class information |
| 11: Collections of Objects |
| Introduction to containers |
| Container disadvantage: unknown type |
| Sometimes it works anyway |
| Making a type-conscious ArrayList |
| Making a stack from a LinkedList |
| Making a queue from a LinkedList |
| Choosing an implementation |
| Sorting and searching Lists |
| Making a Collection or Map unmodifiable |
| Synchronizing a Collection or Map |
| Checking for and creating directories |
| Adding attributes and useful interfaces |
| Reading from an InputStream with FilterInputStream |
| Writing to an OutputStream with FilterOutputStream |
| Sources and sinks of data |
| Modifying stream behavior |
| Off by itself: RandomAccessFile |
| Typical uses of I/O streams |
| File reading & writing utilities |
| Reading from standard input |
| Changing System.out to a PrintWriter |
| Simple compression with GZIP |
| Multifile storage with Zip |
| Sharing limited resources |
| Cooperation between threads |
| Using Pipes for I/O between threads |
| More sophisticated cooperation |
| Interrupting a blocked thread |
| 14: Creating Windows & Applets |
| Running applets from the command line |
| Using listener adapters for simplicity |
| A catalog of Swing components |
| Packaging an applet into a JAR file |
| Binding events dynamically |
| Separating business logic from UI logic |
| Visual programming and JavaBeans |
| A Simple Testing Framework |
| Improving reliability with assertions |
| Using Assertions for Design by Contract |
| Example: DBC + white-box unit testing |
| Ant: the defacto standard |
| Writing your own Handlers |
| Example: Sending email to report log messages |
| Controlling Logging Levels through Namespaces |
| Logging Practices for Large Projects |
| Tracking memory consumption |
| Phase 1: What are we making? |
| Phase 2: How will we build it? |
| Five stages of object design |
| Guidelines for object development |
| Phase 4: Iterate the use cases |
| Strategies for transition |
| 4. Use existing class libraries |
| 5. Don’t rewrite existing code in Java |
| A: Passing & Returning Objects |
| Passing references around |
| Adding cloneability to a class |
| Using a trick with protected |
| Implementing the Cloneable interface |
| The effect of Object.clone( ) |
| Cloning a composed object |
| A deep copy with ArrayList |
| Deep copy via serialization |
| Adding cloneability farther down a hierarchy |
| Why does it work in C++ and not Java? |
| Creating read-only classes |
| The drawback to immutability |
| Overloading ‘+’ and the StringBuffer |
| The String and StringBuffer classes |
| B: Java Programming Guidelines |
| Foundations for Java seminar-on-CD |
| Hands-On Java seminar-on-CD 3rd edition |
| Designing Objects & Systems seminar |
| Thinking in Enterprise Java |
| Thinking in Patterns (with Java) |
| Thinking in Patterns seminar |
| Design consulting and reviews |
| Systems are easier to express and understand |
| Maximal leverage with libraries |
| The Web as a giant server |
| Object creation, use & lifetimes |
| Collections and iterators |
| The singly rooted hierarchy |
| Downcasting vs. templates/generics |
| Garbage collectors vs. efficiency and flexibility |
| Comments and embedded documentation |
| @see: referring to other classes |
| {@link package.class#member label} |
| You must create all the objects |
| Special case: primitive types |
| Aliasing during method calls |
| Unary minus and plus operators |
| Auto increment and decrement |
| Testing object equivalence |
| Common pitfalls when using operators |
| A compendium of operators |
| Distinguishing overloaded methods |
| Overloading with primitives |
| Overloading on return values |
| Calling constructors from constructors |
| Cleanup: finalization and garbage collection |
| The termination condition |
| How a garbage collector works |
| package: the library unit |
| Creating unique package names |
| Using imports to change behavior |
| private: you can’t touch that! |
| protected: inheritance access |
| Specifying initialization |
| Constructor initialization |
| Static data initialization |
| Explicitstaticinitialization |
| Non-static instance initialization |
| Producing the right behavior |
| Pitfall: “overriding” private methods |
| Constructors and polymorphism |
| Order of constructor calls |
| Behavior of polymorphic methods inside constructors |
| “Multiple inheritance” in Java |
| Name collisions when combining interfaces |
| Extending an interface with inheritance |
| Initializing fields in interfaces |
| Inner classes and upcasting |
| Inner classes in methods and scopes |
| The link to the outer class |
| Referring to the outer class object |
| Reaching outward from a multiply-nested class |
| Inheriting from inner classes |
| Can inner classes be overridden? |
| Passing exceptions to the console |
| Converting checked to unchecked exceptions |
| instanceof vs. Class equivalence |
| Arrays are first-class objects |
| Array element comparisons |
| Understanding hashCode( ) |
| HashMap performance factors |
| Creating regular expressions |
| Regular expressions and Java I/O |
| Is StringTokenizer needed? |
| Controlling serialization |
| An alternative to Externalizable |
| Data manipulation with buffers |
| Locking portions of a mapped file |
| Typical uses of I/O streams |
| 3. Formatted memory input |
| 5. Storing and recovering data |
| 6. Reading and writing random access files |
| Creating responsive user interfaces |
| Sharing limited resources |
| Improperly accessing resources |
| A resource testing framework |
| Resolving shared resource contention |
| Synchronizing the EvenGenerator |
| Running applets inside a Web browser |
| A catalog of Swing components |
| Combo boxes (drop-down lists) |
| Sliders and progress bars |
| JavaBeans and synchronization |
| Visual programming and JavaBeans |
| Extracting BeanInfo with the Introspector |
| A more sophisticated Bean |
| JavaBeans and synchronization |
| More complex Bean support |
| |