Java Examples in a Nutshell

Errata for Java Examples in a Nutshell

Submit your own errata for this product.


The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.


Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question Note Update



Version Location Description Submitted By Date Submitted
Printed Page 32
Top of Page

I am using Forte, an IDE from SUN based on NetBeans. It seems to be incompatible with having a main function in an inner class. I c annot figure out how to execute the class and/or debug it from within Forte. Forte is really wonderful (especially since its free) and your examples really should work within it.

Anonymous   
Printed Page 36
The switch statement (third title within the page)

switch does NOT support the long type. Reasons: 1) It keeps just 32 bits for this. 2) Test it out...

Anonymous   
Printed Page 36
main() on this page

I compile LinkedList (Example 2-8) and see LinkedList$Test.class. When I do javap LinkedList.Test, I see main(). However, how can I invoke my main function to test the LinkedList program? The command -- java LinkedList.Test -- does not work.

Anonymous   
Printed Page 66
Example 3-8

When I open HTMLWriter.html in Netscape 4.75, I get an error as follows: Applet HTMLWriter$Test error: java.lang.ClassFormatError: Wrong class name inside class file

Anonymous   
Printed Page 72
"compute" method in example

The declaration of the compute method should be: static void compute() not static synchronized void compute() Making this method synchronized prevents copies running concurrently on multiprocessor machines or even just interleaved on JVMs that implement native threads.

Anonymous   
Printed Page 78
Figure 4.5 Timer.java

Use of the TreeSet class. Sets do not allow duplicates. The TimerTaskComparator will consider as duplicates any two tasks with the same value for the nextTime field, even though they are different tasks. This will cause the tasks.add method to fail some of the time in somewhat random ways in the Timer.schedulee(TimerTask) method. TimerTasks will be somewhat randomly dropped from the tasks object.

Anonymous   
Printed Page 93
3rd paragraph

"So instead, I run a simple proxy server,like the one in Example5-6, on oxymoron" should be written as "So instead, I run a simple proxy server,like the one in Example5-6, on the host computer that www.oreilly.com web server runs.".

Anonymous   
Printed Page 188
in the example

I've tried the SendMail Example but it didn't work. I've tried with different mail hosts. Does this example not work with an SMTP Mailserver? Because with the Java Mail Api, I can send mail via the same SMTP Server. Description: *********** It took a long time in Line: PrintWriter out = new PrintWriter(new OutputStreamWriter(c.getOutputStream())); and after a while an exception was thrown with content: Connection reset by peer

Anonymous   
Printed Page 218
bottom of page

I cannot seem to get Scribble.java to compile. ScribblePane1, 2, and 4 will compile but SP3 will not compile and neither will Scribble. Here are the error messages I receive when compiling: For ScribblePane3: D:JavaexamplesJavaExamples2comdavidflanaganexamplesguiScribblePane3.java:21: cannot resolve symbol symbol : class ScribblePane2 location: class ScribblePane3 public class ScribblePane3 extends ScribblePane2 { D:JavaexamplesJavaExamples2comdavidflanaganexamplesguiScribblePane3.java:35: cannot resolve symbol symbol: method clear () public void actionPerformed(ActionEvent e) { clear(); } D:JavaexamplesJavaExamples2comdavidflanaganexamplesguiScribblePane3.java:37: cannot resolve symbol symbol : method add (javax.swing.JButton) location: class ScribblePane3 this.add(clear); D:JavaexamplesJavaExamples2comdavidflanaganexamplesguiScribblePane3.java:44: cannot resolve symbol symbol: method setColor (java.awt.Color) setColor(colors[colorList.getSelectedIndex()]); D:JavaexamplesJavaExamples2comdavidflanaganexamplesguiScribblePane3.java:47: cannot resolve symbol symbol : method add (javax.swing.JList) location: class ScribblePane3 this.add(colorList); 5 errors For Scribble: D:JavaexamplesJavaExamples2comdavidflanaganexamplesguiScribble.java:34: cannot resolve symbol symbol : class ScribblePane2 location: class Scribble ScribblePane2 scribblePane; D:JavaexamplesJavaExamples2comdavidflanaganexamplesguiScribble.java:57: cannot resolve symbol symbol : class ScribblePane2 location: class Scribble scribblePane = new ScribblePane2(); 2 errors

Anonymous   
Printed Page 472
Purpose of last item in a table

goGet() and doPost() -> doGet() and doPost() The HTTP/1.1 spec (Sec. 2.2) defines <CR><LF> as the end-of-line marker for all protocol elements. The program HttpClient.java uses ' ' (<LF>). While some Web servers are tolerant of this out-of-spec behavior, not all are.

Anonymous