Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"Bruce Eckel" class file

 
mamta jindal
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 com.bruceeckel.simpletest.*;

import file.if anybody knows about that plz tell me.
thanks
mamta
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

import com.bruceeckel.simpletest.*;

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.

Good Luck

Mark
 
Chiok Jarse
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.mindviewinc.com/downloads/TIJ-3rd-edition4.0.zip

The zip file contains the code.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And here are the instructions...

http://mindview.net/Books/TIJ/#SourceCode
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic