Java Examples in a Nutshell, Third Edition
By David Flanagan
January 2004
Pages: 718
Series: In a Nutshell
ISBN 10: 0-596-00620-9 |
ISBN 13: 9780596006204




(Average of 2 Customer Reviews)


Description
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. The chapters on XML and servlets have been rewritten to cover the latest versions of the specifications and to demonstrate best practices for Java 1.4. New and updated examples throughout the book demonstrate many other new Java features and APIs.
Full Description
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. The chapters on XML and servlets have been rewritten to cover the latest versions of the specifications and to demonstrate best practices for Java 1.4. New and updated examples throughout the book demonstrate many other new Java features and APIs.
Java Examples in a Nutshell is a companion volume to
Java in a Nutshell,
Java Foundation Classes in a Nutshell, and
Java Enterprise in a Nutshell. It picks up where those quick references leave off, providing a wealth of examples for both novices and experts. This book doesn't hold your hand; it simply delivers well-commented working examples with succinct explanations to help you learn and explore Java and its APIs.
Java Examples in a Nutshell contains examples that demonstrate:
- Core APIs, including I/O, New I/O, threads, networking, security, serialization, and reflection
- Desktop APIs, highlighting Swing GUIs, Java 2D graphics, preferences, printing, drag-and-drop, JavaBeans, applets, and sound
- Enterprise APIs, including JDBC (database access), JAXP (XML parsing and transformation), Servlets 2.4, JSP 2.0 (JavaServer Pages), and RMI
The book begins with introductory examples demonstrating structured and object-oriented programming techniques for new Java programmers. A special index at the end of the book makes it easy to look up examples that use a particular Java class or accomplish a desired task. In between, each chapter includes exercises that challenge readers and suggest further avenues for exploration.
Featured customer reviews

Very good, even without Java In a Nutshell as a companion!,
February 26 2007
Submitted by Anonymous Reader [
Respond |
View]
I think that this is a very good book. I do not yet have the original Java in a Nutshell book (just ordered it), and yet, I can still learn very effectively with this book. this goes to show that these examples are so exemplary that i can learn Java solely by studying them. A must have!
Great Book - A must for any library,
April 13 2004
Submitted by
Vinny Carpenter
[
Respond |
View]
In this 3rd edition, author David Flanagan has updated the book with coverage of Java 1.4. In keeping with the tradition of the other nutshell books, this book is an instant must-have book. This book is divided into 4 sections. The first section is a short yet very nice Java and OO tutorial. This book is not meant to replace your regular tutorial book, but can certainly act as that for someone who already knows the basics and is trying to bone up on the language API and usage.
The second section of the book covers the core Java API, including I/O, NIO, threads, networking, security and cryptography, serialization, and reflection. This section of the book is really solid and includes great working and commented examples of most of the core set of Java API. I really liked the network section as it includes code that will fulfill most of your needs in terms of network related development.
The third section of the book deals with graphics and user-interface including Swing, Java 2D graphics, preferences, printing, drag-and-drop, JavaBeans, applets, and sound. Not being much of a UI guy, I glossed over most of this section but it seemed complete and comprehensive. I know where I am going to turn if I ever need to work with Swing or applets.
The last section of the book includes coverage of the server-side Java or J2EE development, including JDBC, JAXP (XML parsing and transformation), Servlets 2.4, JSP 2.0, and RMI. Being a back-end or server side developer, I spent a lot of time consuming this section and I was very impressed with the quality of the coverage, explanation and examples included in this section. The section starts off with a nice introduction to JDBC, database metadata and includes some nice examples configurable example that are ready for use with little or no modifications. I think that's important to new developers that are getting familiar with an API. In reading the code, it was nice to see the author using the execute() method instead of executeUpdate() or executeQuery() method along with a simple explanation of why he is doing that. Sounds simple, but I can't tell you the number of times junior developers have come to me and asked me about this exact topic.
After JDBC, the book jumps into XML with a nice intro to SAX, DOM, and XSLT. Not a lot of meat here, but XML is always a moving target in terms of the API. I wish this section had a little more to it as it is missing the whole idea of Java-XML data binding which is a useful topic. After XML, the book moves over to Servlets and JSP. Nice intro to servlets and JSP, but leaves you wanting more. I think the whole server-side Java just needs to be another book and I think David should just come up with a Java Enterprise Examples in a nutshell. O'Reilly already has some great books in this category including the Java Servlet and JSP cookbook.
Having said all that, I still really like this book for how it deals with the core API. This book contains 193 complete, documented examples which makes it a must for any junior developer that knows or is learning Java and wants to know how to apply the API. The examples from this book are available for download from the author's website located at davidflanagan.com.
--Vinny Carpenter
http://www.j2eegeek.com/
Read all reviews
Media reviews
"You'll notice that this is the 3rd edition of the book, and it remains money well spent, eve if you already own an earlier edition. The XML and servlets chapters, for example, have been totally rewritten with Java 1.4 in mind, and all-new examples pepper the pages throughout...You won't find much better reading, and doing, than this."
PC Plus Editor's Choice
Overall rating: 9/10
--Davey Winder,
PC Plus, November 2004
"[This book] should be an essential part of your personal library if you are a Java professional... Quite simply, this should be a 'must buy' for your Java library. This book bridges the gap between reference material and your actual coding better than any other book of its kind."
--Thomas Duff, Portland Domino/Notes User Group, March 2004
http://www.amazon.com/exec/obidos/tg/detail/-/0596006209/cm_aya_asin.title/002-3500893-0863261?v=glance&s=books
Read all reviews