It's great to have found this site as a beginning Java programmer. I am working on a program that uses the Workbook class. This is what I've imported:
import static java.lang.System.*;
An error comes up saying that jxl does not exist. Any ideas?
Re: Workbook class
When you compile (or run) a Java program you have to tell the javac ( or java) executable where it can find the classes you are using. Generally you don't do anything special with respect to System, File and the like because they are"built in" in some sense. But the jxl package you are using is different because it is not part of the standard Java libraries.
The bottom line is that you must tell the javac executable where the jxl package resides - most likely a jar file, but that's just a guess: consult the documentation that came with the library you are using.
The list of locations where classes can be found (directories and jar archives) is known as the classpath but resist the temptation to define a CLASSPATH system variable as this is not very flexible. Instead you specify the classpath when you invoke the compiler. Something like
-cp is saying the compiler should look for unusual classes in the jxl.jar file. But, again, consult the docs for how they reccomend doing things. And recognise that IDEs provide their own mechanism for setting the classpath.
Don't import java.lang classes (it's not necessary). And - just personal taste - the static import of System is a bit odd. You can't avoid bloat in Java! Just say System.out if that's what you mean. (And like any code you write, don't use static imports unless you understand them and mean to use them.)