Originally posted by Bob Beerbower:
...Bruce's import statements compile, mine do not...
As Ernest pointed out, the static import...
import
static net.mindview.util.Print.*;
...works with an unqualified call of the static method...
print("A String.");
But the regular imports...
import net.mindview.util.*;
...or...
import net.mindview.util.Print;
...require a qualified call...
Print.print("A String.");
So... If the static import code is compiling, but the regular import code is not, my guess is that your method calls are simply not specifying the class "Print" in conjunction with the regular imports.
(PS: I just got Eckel's new 4th edition as well. When I saw your post, I downloaded the code to
test this. I put it under my java/library directory because that's where my system classpath is pointing -- or so I thought! I've been using this machine for months, and never noticed that my system classpath was set incorrectly. Shows how much I use
that setting.)
[ March 04, 2006: Message edited by: marc weber ]