Java Cookbook: Solutions and Examples for Java Developers

Overview

The Java Cookbook is a comprehensive collection of problems, solutions, and practical examples for anyone programming in Java. Developers will find hundreds of tried-and-true Java "recipes" covering all of the major APIs as well as some APIs that aren't as well documented in other Java books.The Java Cookbook, like the bestselling Perl Cookbook, covers a lot of ground, and offers Java developers short, focused pieces of code that can be easily incorporated into other programs. The idea is to focus on things that ...

See more details below
Available through our Marketplace sellers.
Other sellers (Paperback)
  • All (38) from $1.99   
  • New (3) from $12.99   
  • Used (35) from $1.99   
Close
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any BN.com coupons and promotions
$12.99
Seller since 2008

Feedback rating:

(169)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

New
0596001703 BRAND NEW NEVER USED IN STOCK 125,000+ HAPPY CUSTOMERS SHIP EVERY DAY WITH FREE TRACKING NUMBER

Ships from: fallbrook, CA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
$33.60
Seller since 2009

Feedback rating:

(872)

Condition: New
0596001703 *BRAND NEW* Ships Same Day or Next!

Ships from: Springfield, VA

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$50.00
Seller since 2014

Feedback rating:

(164)

Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing All
Close
Sort by
Sending request ...

Overview

The Java Cookbook is a comprehensive collection of problems, solutions, and practical examples for anyone programming in Java. Developers will find hundreds of tried-and-true Java "recipes" covering all of the major APIs as well as some APIs that aren't as well documented in other Java books.The Java Cookbook, like the bestselling Perl Cookbook, covers a lot of ground, and offers Java developers short, focused pieces of code that can be easily incorporated into other programs. The idea is to focus on things that are useful, tricky, or both. The book includes code segments covering many specialized APIs—like media and servlets—and should serve as a great "jumping-off place" for Java developers who want to get started in areas outside of their specialization.The book provides quick solutions to particular problems that can be incorporated into other programs, but that aren't usually programs in and of themselves.

Read More Show Less

Editorial Reviews

From Barnes & Noble
The Barnes & Noble Review
If you're a Java programmer, why reinvent the wheel? By now, someone has created elegant solutions for many of the most troublesome problems you're likely to face. That someone is Ian Darwin, whose Java Cookbook offers nearly 900 pages of rip-and-run code snippets, covering everything from regular expressions to RMI, from data structures to servlets.

Darwin's modeled his book on O'Reilly's legendary Perl Cookbook. That's a very high standard he's set for himself -- and he's lived up to it. His range is extraordinary and includes plenty of examples for the hottest areas of Java development.

Working with XML for the first time? You'll find concise, easy-to-borrow code for the tasks you'll need to perform right away: parsing XML with SAX and/or DOM, verifying structure, generating new XML, and transforming XML with XSLT. Building server-side web apps? There's code for setting cookies, tracking sessions, presenting dynamic pages, even generating PDF from a servlet. (In this chapter, Darwin even throws in Java code for a skeleton "news portal" site, à la Slashdot.)

Java Cookbook contains practical solutions for areas of Java you may have barely touched. Need to mail-enable your apps? Work more effectively with threads? Call Java from native code? Use introspection? Internationalize your software? Read or write compressed files? Make the most of Java's underutilized pattern-matching capabilities? It's all here. If you don't have time to waste, waste no time getting Java Cookbook. (Bill Camarda)

Bill Camarda is a consultant, writer, and web/multimedia content developer with nearly 20 years' experience in helping technology companies deploy and market advanced software, computing, and networking products and services. His 15 books include Special Edition Using Word 2000 and Upgrading & Fixing Networks For Dummies®, Second Edition.

Read More Show Less

Product Details

  • ISBN-13: 9780596001704
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 6/1/2001
  • Series: One-Off Series
  • Edition description: Older Edition
  • Pages: 888
  • Product dimensions: 9.00 (w) x 6.94 (h) x 1.60 (d)

Meet the Author

Ian F. Darwin has worked in the computer industry for three decades. He wrote the freeware file(1) command used on Linux and BSD and is the author of Checking C Programs with Lint, Java Cookbook, and over seventy articles and courses on C and Unix. In addition to programming and consulting, Ian teaches Unix, C, and Java for Learning Tree International, one of the world's largest technical training companies.

Read More Show Less

Read an Excerpt

Chapter 18: Web Server Java: Servlets and JSP

Introduction

This chapter covers Web Server Java, but you won't find anything about writing CGI programs in Java here. Although it would be entirely possible to do so, it would not be efficient. The whole notion of CGI programs is pretty much passe. Every time a CGI program is invoked, the web server has to create a new heavyweight process in which to run it; this is inefficient. If it's interpreted in Java, the program has to be translated into machine code each time; this is even more inefficient.

Today's trend is toward building functionality into the web server: Microsoft ASP, PHP3, Java servlets, and JavaServer Pages? (JSP1) are examples of this. None of these normally requires a separate process to be created for each request; the Java-based solutions run in a thread (see Chapter 24) inside the web server, and the Java bytecode need only be translated into machine code once in a long while, assuming a just-in-time (JIT) runtime system. Naturally, this book concentrates on the Java solutions.

We'll use two examples in this chapter. Consider the task of displaying a web page with five randomly chosen integer numbers (lottery players love this sort of thing). The Java code you need is simple:


// Part of file netweb/servlets_jsp/FiveInts.java 

Random r = new Random(  ); 

for (int i=0; i<5; i++) 
 
    System.out.println(r.nextInt(  )); 

But of course you can't just run that and save its output into an HTML file because you want each person seeing the page to get a different set of numbers. If you wanted to mix that into a web page, you'd have to write code to println( ) a bit of HTML. This would be a Java servlet.

The servlet code could get messy, however, since you'd have to escape double quotes inside strings. Worse, if the webmaster wanted to change the HTML, he'd have to approach the programmer's sanctified source code and plead to have it changed. Imagine if you could give the webmaster a page containing a bit of HTML and the Java code you need, and have it magically compiled into Java whenever the HTML was changed. Imagine no longer, says the marketer, for that capability is here now, with JavaServer Pages.

The second example is a dictionary (list of terms); I'll present this both as a servlet and as a JSP.

I won't talk about how you get your servlet engine installed, nor exactly how you install your servlet. If you don't already have a servlet engine, though, I'd recommend downloading Tomcat from http://jakarta.apache.org. Tomcat is the official reference implementation--so designated by Sun--for the servlet and JSP standard. It is also (as you can infer from the URL) the official servlet engine for the ever-popular Apache web server.

First Servlet: Generating an HTML Page

Problem

You want a servlet to present some information to the user.

Solution

Override the HttpServlet method service( ), or doGet( )/doPost( ).

Discussion

The abstract class javax.servlet.Servlet is designed for those who wish to structure an entire web server around the servlet notion. For example, in Sun's Java Web Server, there is a servlet subclass for handling plain HTML pages, another for processing CGI programs, and so on. Unless you are writing your own web server, you will probably not extend from this class, but rather its subclass HttpServlet, in the package javax.servlet.http. This class has a method:


public void service(HttpServletRequest req, HttpServletResponse resp)

throws ServletException, IOException; 

The service method is passed two arguments, request and response. The request contains all the information about the request from the browser, including its input stream should you need to read data. The response argument contains information to get the response back to the browser, including the output stream to write your response back to the user.

But the web has several HTTP methods for passing data into a web page. Unimportant for plain HTML pages, this distinction becomes of interest when processing forms, i.e., web pages with fill-in-the-blank or choice items. Briefly, the GET method of HTTP is used to pass all the form data appended to the URL. GET URLs look like this, for example:


http://www.acmewidgets.com/cgi-bin/ordercgi?productId=123456 

They have the advantage that the user can bookmark them, avoiding having to fill in the form multiple times. But there is a limit of about 1KB on the overall length of the URL. Since this must be a single string, there is an encoding that allows spaces, tabs, colons, and other characters to be presented as two hexadecimal digits: %20 is the character hexadecimal 20, or the ASCII space character. The POST method, by contrast, passes any parameters as input on the socket connection, after the HTTP headers.

The default implementation of the service( ) method in the HttpServlet class figures out which method was used to invoke the servlet. It dispatches to the correct method: doGet( ) if a GET request, doPost( ) if a POST request, etc., passing along the request and response arguments. So while you can, in theory, override the service( ) method, it's more common (and officially recommended) to override either doGet( ), doPost( ), or both.

The simplest HttpServlet is something like Example 18-1....

Read More Show Less

Table of Contents

Preface;
Who This Book Is For;
What’s in This Book?;
Platform Notes;
Other Books;
Conventions Used in This Book;
Comments and Questions;
Getting the Source Code;
Acknowledgments;
Chapter 1: Getting Started: Compiling, Running, and Debugging;
1.1 Introduction;
1.2 Compiling and Running Java: JDK;
1.3 Editing and Compiling with a Color-Highlighting Editor;
1.4 Compiling, Running, and Testing with an IDE;
1.5 Using Classes from This Book;
1.6 Automating Compilation with jr;
1.7 Automating Compilation with make;
1.8 Automating Compilation with Ant;
1.9 Running Applets;
1.10 Dealing with Deprecation Warnings;
1.11 Conditional Debugging without #ifdef;
1.12 Debugging Printouts;
1.13 Using a Debugger;
1.14 Unit Testing: Avoid the Need for Debuggers;
1.15 Decompiling Java Class Files;
1.16 Preventing Others from Decompiling Your Java Files;
1.17 Getting Readable Tracebacks;
1.18 Finding More Java Source Code;
1.19 Program: Debug;
Chapter 2: Interacting with the Environment;
2.1 Introduction;
2.2 Getting Environment Variables;
2.3 System Properties;
2.4 Writing JDK Release-Dependent Code;
2.5 Writing Operating System-Dependent Code;
2.6 Using CLASSPATH Effectively;
2.7 Using Extensions or Other Packaged APIs;
2.8 Parsing Command-Line Arguments;
Chapter 3: Strings and Things;
3.1 Introduction;
3.2 Taking Strings Apart with Substrings;
3.3 Taking Strings Apart with StringTokenizer;
3.4 Putting Strings Together with + and StringBuffer;
3.5 Processing a String One Character at a Time;
3.6 Aligning Strings;
3.7 Converting Between Unicode Characters and Strings;
3.8 Reversing a String by Word or Character;
3.9 Expanding and Compressing Tabs;
3.10 Controlling Case;
3.11 Indenting Text Documents;
3.12 Entering Non-Printable Characters;
3.13 Trimming Blanks from the End of a String;
3.14 Parsing Comma-Separated Data;
3.15 Program: A Simple Text Formatter;
3.16 Program: Soundex Name Comparisons;
Chapter 4: Pattern Matching with Regular Expressions;
4.1 Introduction;
4.2 Regular Expression Syntax;
4.3 How REs Work in Practice;
4.4 Using Regular Expressions in Java;
4.5 Testing REs Interactively;
4.6 Finding the Matching Text;
4.7 Replacing the Matching Text;
4.8 Printing All Occurrences of a Pattern;
4.9 Printing Lines Containing a Pattern;
4.10 Controlling Case in match( ) and subst( );
4.11 Precompiling the RE;
4.12 Matching Newlines in Text;
4.13 Program: Data Mining;
4.14 Program: Full Grep;
Chapter 5: Numbers;
5.1 Introduction;
5.2 Checking Whether a String Is a Valid Number;
5.3 Storing a Larger Number in a Smaller;
5.4 Taking a Fraction of an Integer Without Using Floating Point;
5.5 Ensuring the Accuracy of Floating-Point Numbers;
5.6 Comparing Floating-Point Numbers;
5.7 Rounding Floating-Point Numbers;
5.8 Formatting Numbers;
5.9 Converting Between Binary, Octal, Decimal, and Hexadecimal;
5.10 Operating on a Series of Integers;
5.11 Working with Roman Numerals;
5.12 Formatting with Correct Plurals;
5.13 Generating Random Numbers;
5.14 Generating Better Random Numbers;
5.15 Calculating Trigonometric Functions;
5.16 Taking Logarithms;
5.17 Multiplying Matrixes;
5.18 Using Complex Numbers;
5.19 Handling Very Large Numbers;
5.20 Program: TempConverter;
5.21 Program: Number Palindromes;
Chapter 6: Dates and Times;
6.1 Introduction;
6.2 Finding Today’s Date;
6.3 Printing Date/Time in a Specified Format;
6.4 Representing Dates in Other Epochs;
6.5 Converting YMDHMS to a Calendar or Epoch Seconds;
6.6 Parsing Strings into Dates;
6.7 Converting Epoch Seconds to DMYHMS;
6.8 Adding to or Subtracting from a Date or Calendar;
6.9 Difference Between Two Dates;
6.10 Comparing Dates;
6.11 Day of Week/Month/Year or Week Number;
6.12 Calendar Page;
6.13 High-Resolution Timers;
6.14 Sleeping for a While;
6.15 Program: Reminder Service;
Chapter 7: Structuring Data with Java;
7.1 Introduction;
7.2 Data Structuring Using Arrays;
7.3 Resizing an Array;
7.4 Like an Array, but More Dynamic;
7.5 Data-Independent Access with Iterators;
7.6 Structuring Data in a Linked List;
7.7 Mapping with Hashtable and HashMap;
7.8 Storing Strings in Properties and Preferences;
7.9 Sorting a Collection;
7.10 Sorting in Java 1.1;
7.11 Avoiding the Urge to Sort;
7.12 Sets;
7.13 Finding an Object in a Collection;
7.14 Converting a Collection to an Array;
7.15 Rolling Your Own Iterator;
7.16 Stack;
7.17 Multidimensional Structures;
7.18 Finally, Collections;
7.19 Program: Timing Comparisons;
Chapter 8: Object-Oriented Techniques;
8.1 Introduction;
8.2 Printing Objects: Formatting with toString( );
8.3 Overriding the Equals Method;
8.4 Overriding the Hashcode Method;
8.5 The Clone Method;
8.6 The Finalize Method;
8.7 Using Inner Classes;
8.8 Providing Callbacks via Interfaces;
8.9 Polymorphism/Abstract Methods;
8.10 Passing Values;
8.11 Roll Your Own Exceptions;
8.12 Program: Plotter;
Chapter 9: Input and Output;
9.1 Introduction;
9.2 Reading Standard Input;
9.3 Writing Standard Output;
9.4 Opening a File by Name;
9.5 Copying a File;
9.6 Reading a File into a String;
9.7 Reassigning the Standard Streams;
9.8 Duplicating a Stream as It Is Written;
9.9 Reading/Writing a Different Character Set;
9.10 Those Pesky End-of-Line Characters;
9.11 Beware Platform-Dependent File Code;
9.12 Reading “Continued” Lines;
9.13 Scanning a File;
9.14 Binary Data;
9.15 Seeking;
9.16 Writing Data Streams from C;
9.17 Saving and Restoring Serialized Objects;
9.18 Preventing ClassCastExceptions with SerialVersionUID;
9.19 Reading and Writing JAR or Zip Archives;
9.20 Reading and Writing Compressed Files;
9.21 Program: Text to PostScript;
9.22 Program: TarList (File Converter);
Chapter 10: Directory and Filesystem Operations;
10.1 Introduction;
10.2 Getting File Information;
10.3 Creating a File;
10.4 Renaming a File;
10.5 Deleting a File;
10.6 Creating a Transient File;
10.7 Changing File Attributes;
10.8 Listing a Directory;
10.9 Getting the Directory Roots;
10.10 Making New Directories;
10.11 Program: Find;
Chapter 11: Programming Serial and Parallel Ports;
11.1 Introduction;
11.2 Choosing a Port;
11.3 Opening a Serial Port;
11.4 Opening a Parallel Port;
11.5 Resolving Port Conflicts;
11.6 Reading and Writing: Lock Step;
11.7 Reading and Writing: Event-Driven;
11.8 Reading and Writing: Threads;
11.9 Program: Penman Plotter;
Chapter 12: Graphics and Sound;
12.1 Introduction;
12.2 Painting with a Graphics Object;
12.3 Testing Graphical Components;
12.4 Drawing Text;
12.5 Drawing Centered Text in a Component;
12.6 Drawing a Drop Shadow;
12.7 Drawing an Image;
12.8 Playing a Sound File;
12.9 Displaying a Moving Image with Video;
12.10 Drawing Text with 2D;
12.11 Printing: JDK 1.1;
12.12 Printing: Java 2;
12.13 Program: PlotterAWT;
12.14 Program: Grapher;
Chapter 13: Graphical User Interfaces;
13.1 Introduction;
13.2 Displaying GUI Components;
13.3 Designing a Window Layout;
13.4 A Tabbed View of Life;
13.5 Action Handling: Making Buttons Work;
13.6 Action Handling Using Anonymous Inner Classes;
13.7 Terminating a Program with “Window Close”;
13.8 Dialogs: When Later Just Won’t Do;
13.9 Getting Program Output into a Window;
13.10 Choosing a File with JFileChooser;
13.11 Choosing a Color;
13.12 Centering a Main Window;
13.13 Changing a Swing Program’s Look and Feel;
13.14 Program: Custom Font Chooser;
13.15 Program: Custom Layout Manager;
Chapter 14: Internationalization and Localization;
14.1 Introduction;
14.2 Creating a Button with I18N Resources;
14.3 Listing Available Locales;
14.4 Creating a Menu with I18N Resources;
14.5 Writing Internationalization Convenience Routines;
14.6 Creating a Dialog with I18N Resources;
14.7 Creating a Resource Bundle;
14.8 JILTing Your Code;
14.9 Using a Particular Locale;
14.10 Setting the Default Locale;
14.11 Formatting Messages;
14.12 Program: MenuIntl;
14.13 Program: BusCard;
Chapter 15: Network Clients;
15.1 Introduction;
15.2 Contacting a Server;
15.3 Finding and Reporting Network Addresses;
15.4 Handling Network Errors;
15.5 Reading and Writing Textual Data;
15.6 Reading and Writing Binary Data;
15.7 Reading and Writing Serialized Data;
15.8 UDP Datagrams;
15.9 Program: TFTP UDP Client;
15.10 Program: Telnet Client;
15.11 Program: Chat Client;
Chapter 16: Server-Side Java: Sockets;
16.1 Introduction;
16.2 Opening a Server for Business;
16.3 Returning a Response (String or Binary);
16.4 Returning Object Information;
16.5 Handling Multiple Clients;
16.6 Network Logging;
16.7 Program: A Java Chat Server;
Chapter 17: Network Clients II: Applets and Web Clients;
17.1 Introduction;
17.2 Embedding Java in a Web Page;
17.3 Applet Techniques;
17.4 Contacting a Server on the Applet Host;
17.5 Making an Applet Show a Document;
17.6 Making an Applet Run a CGI Script;
17.7 Reading the Contents of a URL;
17.8 Extracting HTML from a URL;
17.9 Extracting URLs from a File;
17.10 Converting a Filename to a URL;
17.11 Program: MkIndex;
17.12 Program: LinkChecker;
Chapter 18: Web Server Java: Servlets and JSP;
18.1 Introduction;
18.2 First Servlet: Generating an HTML Page;
18.3 Servlets: Processing Form Parameters;
18.4 Cookies;
18.5 Session Tracking;
18.6 Generating PDF from a Servlet;
18.7 HTML Meets Java: JSP;
18.8 JSP Include/Forward;
18.9 JavaServer Pages Using a Servlet;
18.10 Simplifying Your JSP with a JavaBean;
18.11 JSP Syntax Summary;
18.12 Program: CookieCutter;
18.13 Program: JabaDot Web News Portal;
Chapter 19: Java and Electronic Mail;
19.1 Introduction;
19.2 Sending Email: Browser Version;
19.3 Sending Email: For Real;
19.4 Mail-Enabling a Server Program;
19.5 Sending MIME Mail;
19.6 Providing Mail Settings;
19.7 Sending Mail Without Using JavaMail;
19.8 Reading Email;
19.9 Program: MailReaderBean;
19.10 Program: MailClient;
Chapter 20: Database Access;
20.1 Introduction;
20.2 Text-File Databases;
20.3 DBM Databases;
20.4 JDBC Setup and Connection;
20.5 Connecting to a JDBC Database;
20.6 Sending a JDBC Query and Getting Results;
20.7 Using JDBC Parameterized Statements;
20.8 Using Stored Procedures with JDBC;
20.9 Changing Data Using a ResultSet;
20.10 Changing Data Using SQL;
20.11 Finding JDBC Metadata;
20.12 Program: JDAdmin;
Chapter 21: XML;
21.1 Introduction;
21.2 Transforming XML with XSLT;
21.3 Parsing XML with SAX;
21.4 Parsing XML with DOM;
21.5 Verifying Structure with a DTD;
21.6 Generating Your Own XML with DOM;
21.7 Program: xml2mif;
Chapter 22: Distributed Java: RMI;
22.1 Introduction;
22.2 Defining the RMI Contract;
22.3 RMI Client;
22.4 RMI Server;
22.5 Deploying RMI Across a Network;
22.6 Program: RMI Callbacks;
22.7 Program: RMIWatch;
Chapter 23: Packages and Packaging;
23.1 Introduction;
23.2 Creating a Package;
23.3 Documenting Classes with Javadoc;
23.4 Archiving with jar;
23.5 Running an Applet from a JAR;
23.6 Running an Applet with a JDK;
23.7 Running a Program from a JAR;
23.8 Preparing a Class as a JavaBean;
23.9 Pickling Your Bean into a JAR;
23.10 Packaging a Servlet into a WAR File;
23.11 “Write Once, Install Anywhere”;
23.12 Java Web Start;
23.13 Signing Your JAR File;
Chapter 24: Threaded Java;
24.1 Introduction;
24.2 Running Code in a Different Thread;
24.3 Displaying a Moving Image with Animation;
24.4 Stopping a Thread;
24.5 Rendezvous and Timeouts;
24.6 Thread Communication: Synchronized Code;
24.7 Thread Communication: wait( ) and notifyAll( );
24.8 Background Saving in an Editor;
24.9 Threaded Network Server;
Chapter 25: Introspection, or “A Class Named Class”;
25.1 Introduction;
25.2 Getting a Class Descriptor;
25.3 Finding and Using Methods and Fields;
25.4 Loading and Instantiating a Class Dynamically;
25.5 Constructing a Class from Scratch;
25.6 Performance Timing;
25.7 Printing Class Information;
25.8 Program: CrossRef;
25.9 Program: AppletViewer;
Chapter 26: Using Java with Other Languages;
26.1 Introduction;
26.2 Running a Program;
26.3 Running a Program and Capturing Its Output;
26.4 Mixing Java and Scripts with BSF;
26.5 Blending in Native Code (C/C++);
26.6 Calling Java from Native Code;
26.7 Program: DBM;
Chapter 27: Afterword;
Colophon;

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 4 Customer Reviews
  • Anonymous

    Posted February 19, 2003

    This book has earned a valued place on my reference shelf

    The Java Cookbook is a collection of hundreds of solutions to problems that Java programmers frequently face. The book assumes that the reader is familiar with Java. The book aims at the Java 2 platform. The recipes range from simple tasks to entire programs that for example demonstrate how to use the incorporate email into your application. The book is organized in a simple, clear and easy to read style. The first couple of chapters provide an an introduction to compiling, running, debugging and interacting with the environment then goes on to discussing the core API's like Strings, Arrays, Wrappers, Files I/O, Collections, AWT etc. before moving on to advanced topics like server side Java, database JDBC access, RMI, mutithreaded applications, native code interactions, XML applications, Enterprise Java (J2EE) etc. Overall a very good book and handy reference for development with Java. However, the book does provide lop sided coverage providing lots of coverage in certain areas like JavaMail but very little on JSP, Servlets, XML and almost nothing on Web Services. J2EE and other server side developers are sure to be disappointed. There is negligible discussion on design patterns. However, no other single book does as much to demonstrate with examples Java's capabilities in such a nutshell. A handy reference to have in your shelf.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted June 7, 2002

    Excellent reference

    I had been searching for a good book that served as a reference for short snippets of code, similar to what ¿The Visual Basic 6 Black Book¿ did for VB and my understanding of it. I had seen ¿Java Black Book¿ at bookstores, but really was hesitant on purchasing it after seeing an unkind review for it. After mentioning this to someone, he loaned me his copy of Java Cookbook so that I would see what it was like. A few days later, I was returning his copy because I had already obtained my own. I was sold!!<P> There is tremendous amounts of detail in this book, starting from the author¿s own package of goodies, to small routines adapted from other texts on programming (and giving due credit to these references), to extended examples of code that solve a myriad of problems. All of the code is downloadable from the `Net. The table of contents, 5.5 pages long, lists a condensed one-line description for each piece of code in the book.<P> But the book is not only code. The descriptions themselves of the code are practical and helpful as well, explaining reasons behind design decisions for certain structures. I¿ve created my own version of some of his programs (a Roman-numeral class he develops seems to do well in writing them out, but not at reading them. Strange topic to adapt, but I just wanted to challenge myself.) and found that I like mine better, but I¿d probably never have gotten around to doing such until I saw his routines.<P> All in all, this book is a prize possession, and one I¿d like to recommend very heartily.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted November 15, 2001

    Java Cookbook: An Excellent Read

    The Java Cookbook is arguably the best book ever written on the Java programming language. It provides an in depth discussion of most of the technologies available in the Java programming environment without bogging the reader down in too much minutiae. It is an excellent text for introductory computer science courses. It is also an indispensable reference manual for experienced Java programmers.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted August 16, 2001

    Java To Go!

    If I¿d had this book two years ago, I would have saved myself weeks of work. As a software developer of some twenty years, I find that the ever-present problem of `looking things up¿ is the major factor that impedes progress. I¿ve spent hours trying to track down `how-to¿ solutions only to find in the end all that¿s required is a few elusive lines of code. Well, the Java Cookbook is filled with such code along with insightful explanations. I¿m impressed by how comprehensive the coverage is: 26 chapters covering such things as file i/o, Swing, RMI, applets, Java Servlets, JSP, e-mail, JDBC, XML, multi-threading¿ At 48 pages, the index is HUGE, just what you need to look things up! The author assumes you know Java but not as well as you ought to! He explains all those things that I really should know but I never get around to figuring out properly: the correct handling of dates/times, internationalization, floating point numbers, etc. Thankfully, the book is concise and easy to read so you can quickly plug a bunch of gaps in your knowledge by browsing over chapters. This book will quickly pay for itself. Enjoy.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing all of 4 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)