Java Examples in a Nutshell

A Tutorial Companion to Java in a Nutshell

David Flanagan

Publisher: O'Reilly, 1997, 397 pages

ISBN: 1-56592-371-5

Keywords: Java, Programming

Last modified: April 12, 2021, 1:09 p.m.

Java Examples in a Nutshell is chock-full of practical, real-world Java programming examples. The author of the bestselling Java in a Nutshell has created an entire book of example programs that you can learn from and modify for your own use. If you learn best "by example", this is the book for you.

This book is a companion volume to Java in a Nutshell. While Java in a Nutshell is a quick-reference at heart, it also includes an accelerated introduction to Java programming. Java Examples in a Nutshell picks up where that leaves off, providing a suite of example programs novice and Java programmers and experts alike. This book doesn't hold your hand or supply detailed explanations of Java syntax or method calls; it simply delivers well-commented, working examples that explore the wide range of what is possible with Java 1.1. Each chapter concludes with programming exercises that suggest further avenues for building on what you have learned.

Java Examples in a Nutshell contains the following:

  • All of the example programs from the first edition of Java in a Nutshell, completely updated for Java 1.1. In addition, the I/O, networking, and GUI chapters have been augmented to include even more practical examples.
  • Expanded examples from the second edition of Java in a Nutshell that demonstrate the new features in Java 1.1, including the new AWT event handling model, the JavaBeans API, internationalization, object serialization, and reflection.
  • Never-before-published programming examples for remote method invocation, database connectivity, and security — important elements of the Java Enterprise APIs.
  • A glimpse at the features of "Swing", the set of new components that are part of the forthcoming Java Foundation Classes (JFC).
  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
  2. Objects, Classes, and Interfaces
    • A Rectangle Class
    • Testing the Rect Class
    • A Rect Subclass
    • Another Subclass
    • Complex Numbers
    • Computing Pseudo-Random Numbers
    • Computing Statistics
    • An Linked List Class
    • Advanced Sorting
    • Exercises
  3. Applets
    • Introduction to Applets
    • A First Applet
    • Drawing Graphics
    • Handling Events
    • Reading Applet Parameters
    • Images and Sounds
    • JAR Files
    • Signed Applets
    • Exercises
  4. Graphics
    • Drawing with the Graphics Object
    • Fonts
    • Colors
    • Cursors
    • Simple Animation
    • Animation with Double-Buffering
    • Animation with Images
    • Image Scaling, Cropping, and Flipping
    • Filtering Images
    • Printing an Applet
    • Exercises
  5. Events
    • The Java 1.0 Event Model
    • Scribbling in Java 1.0
    • Java 1.0 Event Details
    • The Java 1.1 Event Model
    • Scribbling in Java 1.1
    • Scribbling with External CLasses
    • Scribbling with Inner Classes
    • Scribbling with Adapter Classes
    • Inside the Java 1.1 Event Model
    • Java 1.1 Event Details
    • Exercises
  6. Graphical User Interfaces
    • Components
    • Containers
    • Layout Management
    • Frames
    • A Closeable Frame
    • Menus
    • Dialogs
    • A Dialog with User Response
    • Custom Components
    • Putting It All Together
    • Exercises
  7. Data Transfer
    • An Overview of Cut-and-Paste
    • Simple String Cut-and-Paste
    • Custom Cut-and-Paste
    • Exercises
  8. 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
    • Filtering Lines of Text
    • A Custom HTML Output Stream
    • A Custom Hardcopy Stream
    • Exercises
  9. Networking
    • Downloading the Contents of a URL
    • Using a URLConnection
    • Sending Email Through a URLConnection
    • Connecting to a Web Server
    • A Simple Web Server
    • A Proxy Server
    • Networking with Applets
    • A Generic Client
    • A Generic Multithreaded Server
    • A Multithreaded Proxy Server
    • Sending Datagrams
    • Receiving Datagrams
    • Exercises
  10. Threads
    • Threads and Thread Groups
    • Deadlock
    • Pipes
    • Exercises
  11. 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
    • Naming Patterns and Conventions
    • Exercises
  12. Reflection
    • Obtaining Class and Member Information
    • Invoking a Named Method
    • Exercises
  13. Object Serialization
    • Simple Serialization
    • Custom Serialization
    • Serialization and Class Versioning
    • Serialized Applets
    • Advanced Versioning
    • Exercises
  14. Internationalization
    • A Word About Locales
    • Unicode
    • Character Encodings
    • Handling Local Customs
    • Localizing User-Visible Messages
    • Formatted Messages
    • Exercises
  15. Remote Method Invocation
    • Remote Banking
    • A Bank Server
    • A Multiuser Domain
    • Remote MUD Interfaces
    • The MUD Server
    • The MudPlace Class
    • The MudPerson Class
    • A MUD Client
    • Exercises
  16. Database Access with SQL
    • Accessing a Database
    • Using Database Metadata
    • Building a Database
    • Using the API Database
    • Atomic Transactions
    • Exercises
  17. Security and Cryptography
    • A Custom Security Manager
    • Message Digests and Digital Signatures
    • Digitally Signed Objects
    • Exercises
  • Appendix: JFC and Swing

Reviews

Java Examples in a Nutshell

Reviewed by Roland Buresund

Good ******* (7 out of 10)

Last modified: Nov. 15, 2008, 11:09 a.m.

As a companion volume to Flanagan's other books, its pretty good.

Comments

There are currently no comments

New Comment

required

required (not published)

optional

required

captcha

required