wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark ""Bruce Eckel" class file" Watch ""Bruce Eckel" class file" New topic
Author

"Bruce Eckel" class file

mamta jindal
Greenhorn

Joined: Jun 29, 2006
Posts: 15
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

Joined: Feb 05, 2001
Posts: 17257
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Chiok Jarse
Greenhorn

Joined: Dec 29, 2005
Posts: 13
http://www.mindviewinc.com/downloads/TIJ-3rd-edition4.0.zip

The zip file contains the code.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

And here are the instructions...

http://mindview.net/Books/TIJ/#SourceCode


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
Don't get me started about those stupid light bulbs.
 
subject: "Bruce Eckel" class file