hi dear frnds actually i have a book of bruce eckal (jdk1.4). but programmes of that book are not runing in my pc. i think his class file is missing. can anybody help me for that.in this book every program is start with
import file.if anybody knows about that plz tell me. thanks mamta
Hi Mamta, sorry you are having some issues with the files.
Let me see if I can help.
1. An "import" statement in Java is not necessarily importing a "file" it is importing a defined class in some package. So in the case of
you are allowing the code you are about to write for the class to be able to use any class defined in the com.bruceeckel.simpletest package. The "*" is what says all classes in that package. A package strucutre will actually follow a directory path, so if your root source directory is c:\mysource. Then from "mysource" you will find \com\bruceeckel\simpletest
When compiling, you need to compile from the mysource directory and not from any of its subdirectories. When you compile, is when you create the class files. This occurs when you run "javac" without the quotes on the "mysource" directory. This is also the directory that you will use "java" to run your "program" passing it the class name of the class that has your "main" method.
So in order to run them on your machine you will need to compile the classes using javac.