Java Examples in a Nutshell, 3rd Edition

Java Examples in a Nutshell, 3rd Edition
Authors
David Flanagan
ISBN
0596006209
Published
01 Jan 2004
Purchase online
amazon.com

The author of the best-selling Java in a Nutshell has created an entire book of real-world Java programming examples that you can learn from. If you learn best "by example," this is the book for you. This third edition covers Java 1.4 and contains 193 complete, practical examples: over 21,900 lines of densely commented, professionally written Java code, covering 20 distinct client-side and server-side APIs. It includes new chapters on the Java Sound API and the New I/O API.

Page 2 of 2
  1. Editorial Reviews
  2. Customer Reviews

Customer Reviews

John Najarian said
Seller was fast and great price.

This book is outstanding for a novice to intermediate developer/programmer. Be sure to get the latest edition. Unlike many OReilly books this wasn't to wordy. Great examples.

F. M. Taylor said
Great overall summary of Java with examples. Replaces short surveys, tutorials and cookbooks of Java.

calvinnme said
This book should not be expected to substitute as a tutorial for people looking to learn the Java language. Instead, it is a book full of short programs that each illustrate specific concepts in the Java language. If you are needing a tutorial on the Java language in general, I suggest "Head First Java", which is also published by O'Reilly and Associates. You can either read the appropriate chapters of this book in parallel with that one, or look through this book after you finish the Head First Java book. If you already know Java, keeping an updated edition of this book around as a reference is a great idea.
The first four chapters of this book cover the basics of Java, objects, classes, interfaces, input/output, and threads. Thus these chapters remain largely unchanged from the previous edition. Chapter 5, on networking, has been updated to reflect the changes in the language since the last edition, and contains examples of a simple network client, an HTTP client, and a POP client in addition to the programs of the previous edition. Chapter six is a new chapter on The new I/O (NIO) APIs introduced in version 1.4. These provide new features and improved performance in the areas of buffer management, scalable network and file I/O, character-set support, and regular-expression matching. The NIO APIs supplement the I/O facilities in the java.io package, and this chapter does a good job of demonstrating the APIs in action. The next chapter that has had a major overhaul is the chapter on printing. Printing in JDK1.4 was updated considerably and allows you to list specific printers with specific capabilities, query printer status, spool text or image files directly to a printer, and convert image files to Postscript files. There are examples of all of these upgrades in this chapter. The chapter on data transfer has largely been rewritten to reflect that Swing has added support for data transfer between applications. When adding data transfer support to Swing, the goal was to make it easy for developers using Swing components to add clipboard transfer as well as drag and drop to an application. The examples in this chapter demonstrate these concepts very well. There is a completely new chapter on the Java Sound API reflecting the capabilities of that API. In addition to simply playing sounds and sequences, the chapter demonstrates synthesizing MIDI and also real-time MIDI. Finally, the last part of the book on the Enterprise API's has been completely rewritten to reflect all of the changes that have taken place in those API's since the last edition due to the popularity of the Java language in enterprise applications.
Currently, this book is two years old, which is getting a bit long in the tooth for a computer book. This is especially true if you consider the fact that JDK 1.5 has been released since this book was published with its own set of upgrades and nuances, and that JDK 1.6 is scheduled for release in the fall of 2006. I don't know if a fourth edition is planned for the immediate future, so if you can get the 3rd edition used for a low price it might still be worth the investment. If you are a Java novice, it is definitely worth your time and money.

JohnJ said
While writing this I can already imagine the shock and dismay of the Fan crowd with my review. I don't have much time so let me get to the point.
The 1 star I've given it (bcs I had to, preferable I'd rate it 0 stars) mostly pertains to the GUI section of the book. Instead of providing the reader with abundant and clear examples, this author wants to impress the Java geeks by writing an 'smart' generic class that shows all the different aspects of the java GUI elements. Aside from just lame, this is also done most likely because of laziness. I can imagine it's not very exciting to write up the core program structure for every GUI example. But that's just the way a decent author would go about. No need to waste pages by explicitly mentioning everything more then once. Such things can be saved for the example source right ? But mr Flanagan does not share that view. He sits back with his (admittedly entertaining) 'showcomponent' program that loads in all the gui program code (classes) and displays the material. So, again, his 'Java examples' are merely small files with therein declared a certain class without any(!) surrounding program code. (basically similar to what you'd see in the Swing lang spec). All these compiled examples need to be read in (from the command line no less, by his showcomponent class which then actually does all the work of creating the frame, displaying it etc etc etc.

And then cometh the reader, . . . . The moment you have to incorporate some of these lay-out en control components in you're own program this entire structure is obviously useless. Hence you have to struggle to get every component to work after all. The exact thing one is trying to avoid by buying a book. (No, you can't just copy & paste several separate sources together :) ). Basically you end up doing all the work yourself in the end anyway. Henceforth this book, particularly the part of GUI's , dialog's and event handling is of little practical use. I guess it would qualify as some sort of java coffee table book. Interesting functions, a clever introspective class here and there, things you can sit back and debate about with you're friends.
Not with you're collegue(s) when you fighting the deadlines.
While I'm not very proficient in Java, I've coded in c/c++ for far too long. Hence I don't need trivial lectures on what a ip port is. I just need to see some _completed_ (as in finished) programs, to get up and running with particular Java idiosyncrasies & components. If you are in a hurry, and simply have to get something up and running, keep running. Away from this piece of trash.
Go with "Core Java" or some of the Swing books. it'll get you there much much faster.

Edit: Took the flames out of the review. I was rather disappointed with this title at first. (now it's just collecting dust, but at least it doesn't aggravate me either).
If you're a programmer, (like me) you can read the spec by yourself. It's the little things on the outside of the program (event & message que's ,window trickery etc.) that differ from platform to platform. Those are the exact things the author glosses over with this text.

Mark Geek Twain said
Just type these in and learn, learn, learn. Good examples across the board.

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook