I’ve decided to name the learn Java posts based on the chapter titles. I’m sure I could use the exact title in the title of the post, but there’s usually no need for that, just something close.
The book says when designing a object think about what it “Knows” and what it “does”. For me it’s just easier to remember Variables and Methods. I suppose I could mix their example with what works for me to get Variables and what it does. It’s just a paradigm to help one remember what your looking for when creating a class. The be correct, your thinking of what the Objects instance Variables and Methods are going to be.
In some ways I see java as being messy with all the files. One file per class, a large program would have a lot of bits and pieces scattered all over the place. Well yes, it would be all in one folder, and yes, it can be contained in a .jar file but still. Of Course I’m looking at it from a solo developer point of view. Where you would have to work on all sorts of different files at any given time. However in a team perspective, it makes more sense, as everybody could easily work on their with out locking out someone else from what that other person has to work on. Good news is keep all the files in one folder then Compile via wild card:
javac *.java
Then hope you didn’t have any errors. I wonder if there is a command to redirect error output to a file. I remember doing that way back when, in High School no less, when we had to learn Pascal. Except instead of file, we dumped to a printer. It was funny, you’d send the job and then listen for the printer.. If it only buzzed for a few lines then you had some small syntax error, maybe forgot to declare a variable or something If it printed pages of errors, you missed a semi-colon and didn’t even bother to look at the printout.
Well looks like I can
javac class.java –Xstdout filename
though in a option to put all the resultant class files in a different directory
javac class.java –Xstdout complemsg.txt –d finished files
That should make everything all neat and tidy.
Comments
Leave a comment Trackback