-
Learning Java
-
Chapter 1 Java Basics
- Hello World
- FizzBuzz
- The Fibonacci Series
- Using Command-Line Arguments
- Echo in Reverse
- FizzBuzz Switched
- Computing Factorials
- Recursive Factorials
- Caching Factorials
- Computing Big Factorials
- Handling Exceptions
- Interactive Input
- Using a StringBuffer
- Sorting Numbers
- Computing Primes
- Exercises
-
Chapter 2 Objects, Classes, and Interfaces
- A Rectangle Class
- Testing the Rect Class
- A Rect Subclass
- Another Subclass
- Complex Numbers
- Computing Statistics
- An Integer List
- Tokenizing Text
- Exercises
-
-
Core Java APIs
-
Chapter 3 Input/Output
- Files and Streams
- Working with Files
- Copying File Contents
- Reading and Displaying Text Files
- Listing Directory and File Information
- Compressing Files and Directories
- Filtering Character Streams
- Tokenizing a Character Stream
- Random Access to Files
- Exercises
-
Chapter 4 Threads
- Thread Basics
- Thread-Safe Classes
- Threads and Thread Groups
- Deadlock
- Timers
- Exercises
-
Chapter 5 Networking
- Downloading the Contents of a URL
- Using a URLConnection
- Sending Email Through a URLConnection
- A Simple Network Client
- A Generic Client
- An HTTP Client
- A POP Client
- A Simple Web Server
- A Proxy Server
- A Generic Multithreaded Server
- Sending Datagrams
- Receiving Datagrams
- Exercises
-
Chapter 6 New I/O
- Locking Files
- Copying Files
- Regular Expressions and Character Decoding
- File Copying with Buffers
- Advanced Byte-to-Character Conversion
- Tokenizing Byte Buffers
- A Simple HTTP Client
- The Daytime Service
- A Multiplexed Server
- A Multiplexed Network Client
- Exercises
-
Chapter 7 Security and Cryptography
- Running Untrusted Code
- Loading Untrusted Code
- Message Digests and Digital Signatures
- Cryptography
- Exercises
-
Chapter 8 Internationalization
- A Word About Locales
- Unicode
- Character Encodings
- Handling Local Customs
- Localizing User-Visible Messages
- Formatted Messages
- Exercises
-
Chapter 9 Reflection
- Obtaining Class and Member Information
- Invoking a Named Method
- Proxy Objects
- Exercises
-
Chapter 10 Object Serialization
- Simple Serialization
- Custom Serialization
- Externalizable Classes
- Serialization and Class Versioning
- Exercises
-
-
Desktop Java APIs
-
Chapter 11 Graphical User Interfaces
- Components
- Containers
- Layout Management
- Event Handling
- A Complete GUI
- Actions and Reflection
- Custom Dialogs
- An Error Handler Dialog
- Displaying Tables
- Displaying Trees
- A Simple Web Browser
- Describing GUIs with Properties
- Themes and the Metal Look-and-Feel
- Look-and-Feel Preferences
- The ShowBean Program
- Exercises
-
Chapter 12 Graphics
- Graphics Before Java 1.2
- The Java 2D API
- Drawing and Filling Shapes
- Transforms
- Line Styles with BasicStroke
- Stroking Lines
- Filling Shapes with Paint
- Antialiasing
- Combining Colors with AlphaComposite
- Image Processing
- Image I/O
- Custom Shapes
- Custom Strokes
- Custom Paint
- Advanced Animation
- Displaying Graphics Examples
- Exercises
-
Chapter 13 Printing
- Printing with the Java 1.1 API
- Printing with the Java 1.2 API
- Printing with the Java 1.4 API
- Printing Multipage Text Documents
- Advanced Printing with Java 1.4
- Exercises
-
Chapter 14 Data Transfer
- Simple Swing Data Transfer
- A Clock with Drag and Copy Support
- Data Transfer Architecture
- Dropping Multiple Datatypes
- A Transferable Shape
- Custom Data Transfer
- Exercises
-
Chapter 15 JavaBeans
- Bean Basics
- A Simple Bean
- A More Complex Bean
- Custom Events
- Specifying Bean Information
- Defining a Simple Property Editor
- Defining a Complex Property Editor
- Defining a Bean Customizer
- Manipulating Beans
- Exercises
-
Chapter 16 Applets
- Introduction to Applets
- A First Applet
- A Clock Applet
- A Timer Applet
- Applets and the Java 1.0 Event Model
- Exercises
-
Chapter 17 Sound
- Ringing the Bell
- Swing Aural Cues
- Playing Sounds with AudioClip
- Playing Sounds with javax.sound
- Streaming Sounds with javax.sound
- Synthesizing a MIDI Sequence
- Real-Time MIDI Sounds
- Exercises
-
-
Enterprise Java APIs
-
Chapter 18 Database Access with SQL
- Accessing a Database
- Using Database Metadata
- Building a Database
- Using the API Database
- Atomic Transactions
- Exercises
-
Chapter 19 XML
- Parsing with JAXP and SAX
- Parsing and Manipulating with JAXP and DOM
- Transforming XML with XSLT
- An XML Pull Parser
- Exercises
-
Chapter 20 Servlets and JavaServer Pages
- Servlet Setup
- A Hello World Servlet
- Another Simple Servlet
- Servlet Initialization and Persistence: A Counter Servlet
- Hello JSP
- Hello JSP2
- Hello XML
- The MVC Paradigm for Web Applications
- ListManager Model Classes
- ListManager Controller
- ListManager Views
- Custom Tags in JSP 2.0
- Packaging a Web Application
- Exercises
-
Chapter 21 Remote Method Invocation
- Remote Banking
- A Bank Server
- A Persistent Bank Server
- A Multiuser Domain
- Remote MUD Interfaces
- The MUD Server
- The MudPlace Class
- The MudPerson Class
- A MUD Client
- Advanced RMI
- Exercises
-
Chapter 22 Example Index
- Symbols
- A
- B
- C
- D
- E
- F
- G
- H
- I
- J
- K
- L
- M
- N
- O
- P
- Q
- R
- S
- T
- U
- V
- W
- X
- Y
- Z
-
-
Colophon
- Title:
- Java Examples in a Nutshell, Third Edition
- By:
- David Flanagan
- Publisher:
- O'Reilly Media
- Formats:
-
- Ebook
- Safari Books Online
- Print Release:
- January 2004
- Ebook Release:
- February 2009
- Pages:
- 720
- Print ISBN:
- 978-0-596-00620-4
- | ISBN 10:
- 0-596-00620-9
- Ebook ISBN:
- 978-0-596-10412-2
- | ISBN 10:
- 0-596-10412-X
Our look is the result of reader comments, our own experimentation, and feedback from distribution channels. Distinctive covers complement our distinctive approach to technical topics, breathing personality and life into potentially dry subjects. The animal on the cover of Java Examples in a Nutshell, Third Edition, is an alligator. There are only two species of alligator: the American alligator (Alligator mississippiensis), found in the southeastern coastal plain of the United States, and the smaller Chinese alligator (Alligator sinensis), found in the lower valley of the Yangtze River. Both alligators are related to the more widely distributed crocodile.
The alligator is a much-studied animal, so a great deal is known about its life cycle. Female alligators lay 30 to 80 eggs at a time. The mother allows the sun to incubate the eggs, but stays nearby. After about 60 days the eggs hatch, and the young call out for their mother. The mother then carries or leads them to the water, where they live with her for a year.
Alligators eat a varied diet of insects, fish, shellfish, frogs, water birds, and small mammals. Alligator attacks on humans are rare. Although normally slow-moving animals, alligators can charge quickly for short distances when they or their young are in danger.
Alligators have been hunted extensively for their skin. The American alligator was placed on the endangered species list in 1969, then declared to be out of danger in 1987. The Chinese alligator remains on the endangered list. Genevieve d'Entremont was the production editor and copyeditor for Java Examples in a Nutshell, Third Edition. Emily Quill, Reg Aubry, and Claire Cloutier provided quality control. Jamie Peppard and Matt Hutchinson provided production assistance. Julie Hawks updated the index.
Edie Freedman designed the cover of this book. The cover image is a 19th-century engraving from Old Fashioned Animal Cuts. Emma Colby produced the cover layout with QuarkXPress 4.1 using Adobe's ITC Garamond font.
Melanie Wang designed the interior layout, based on a series design by David Futato. This book was converted by Joe Wizda to FrameMaker 5.5.6 with a format conversion tool created by Erik Ray, Jason McIntosh, Neil Walls, and Mike Sierra that uses Perl and XML technologies. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSans Mono Condensed. The illustrations that appear in the book were produced by Robert Romano using Adobe Photoshop 6. This colophon was written by Clairemarie Fisher O'Leary.
