PDA

View Full Version : "Thinking in Java"




bill macleod
Sep 23, 2006, 11:43 AM
I'm using a mac book pro, jdk5. And I'm real new.....

I've seen this book mentioned in a few posts here, I think.


"Thinking in Java" by Bruce Eckles

I'm having a little trouble understanding the way he has his downloadable code it set up.

I downloaded the files put them in my /Developer folder and ran Ant on

them to build as the instructions said. But I guess I still dont get it. I can

dig around to find the code in the file. Or I can just type it out of the book.

I get the Idea that you import something from the file as you would import

packages or methods. But I not familiar with this technique yet, as I'm

brand new to programming. About a month into an online course.

If there is anyone who has gone through this book and can help me out, I

sure would appreciate it.

I'll attach his instructions and what the code looks like in the book so

everyone knows what I'm talking about.

Thanks



mufflon
Sep 23, 2006, 12:13 PM
I got a bit of a headache reading your text - can you please press "enter" only where you've ended your sentences please?


Anyhow I'll dig around to see if I can help :)

edit: the static input seems to be pretty bad (well relatively speaking) clickety (http://java.sun.com/j2se/1.5.0/docs/guide/language/static-import.html)

edit2: you can import stuff that lies in the same directory as yours by simply doing
import *class name*

other than that you need a better explanation for me to understand you better

bill macleod
Sep 24, 2006, 04:12 PM
thanks for your reply.
I'll try and figure out how to ask my question more clearly.
I was just doing as a little extra project, but right now my
assignment in class is givin me fits. When I get that figured
out I'll concentrate on "Thinking in Java" again.
Thanks again for your reply, sorry about the headaches.

Eraserhead
Sep 24, 2006, 05:28 PM
Bill

I have to admit I still find doing classpaths is very tricky, even though I've done quite a bit of Java programming. In the instructions Eclipse (http://www.eclipse.org/downloads/) is (kinda) suggested though it is excellent it has quite a steep learning curve.

I would recommend as long as you are learning that you give Xcode a go, for serious Java programming you will want to use Eclipse as it is cross-platform (so you can program the project on OS X, Linux and Windows if you need to.) and it produces official javadoc documentation (Apple I'm looking at YOU to support this in XCode.), XCode should have come free with your Mac, alternatively if you haven't got a mac in the last year or 2, you can download the latest version (it's a hefty 900MB so you'll need broadband) by creating a free Apple developer account on http://developer.apple.com, it can create an Ant project (as shown in the screenshot below) which should solve your problems.

Eraserhead

bill macleod
Sep 25, 2006, 01:40 PM
I got to apologize, my first post was not very clear....
The Ant build went fine. I did it as per the instructions in the book, in the terminal. It stopped and returned the expected error message.
I guess the thing I'm unclear on is...what all this building and downloading and so forth is supposed to accomplish. I'm thinking it is all just to save typing the sample src from the book into an editor to see how it works. Or is there more to it than that?

I am using Eclipse on my intel mac. I like it alot. The class I'm taking is structured around using JBuilder. I'll be transfering to a new school in the winter and they don't offer any java. It is all going to be C++. Which would probably be a real good reason to get used to XCode now. I would eventually like to be able to program for my own enjoyment, for my mac.


Thanks again for your reply

bill

Eraserhead
Sep 25, 2006, 03:08 PM
I got to apologize, my first post was not very clear....
The Ant build went fine. I did it as per the instructions in the book, in the terminal. It stopped and returned the expected error message.
I guess the thing I'm unclear on is...what all this building and downloading and so forth is supposed to accomplish. I'm thinking it is all just to save typing the sample src from the book into an editor to see how it works. Or is there more to it than that?

Bill

You are building it so you can run the software, to see how it works in reality, you are also checking you haven't made any errors, normally with programming books I have typed out the code myself from the book rather than just downloading it so I get a better feel for the language.

Eraserhead

bill macleod
Sep 25, 2006, 03:35 PM
That makes perfect sense to me. Thats what I'll do. Besides; typing is something I can always use more practice with. One of these days I'm gonna write a whole sentence without looking at the keyboard.

thanks again

bill