Although I won’t comment on the expressivness of OT ( ) I will second and third the recommendation for Thinking in Java. A fantastic read. i bought the physical copy and also keep an electronic ( free as in beer 8) ) copy on my computer and in my PDA.
Generally it’s a bit overambitious to get into file I/O first thing. You should make some more useless programs and learn object oriented stuff before you can appreciate the design of the Java I/O classes.
About the naming conventions, in java you don’t use names like do_something, you use doSomething. I’m sure the relevant document was linked above.
What’s special about file I/O?
I can see telling someone not to start out with writing their own web server, but writing a program that reads some files is the sort of thing I would want people to start out doing as soon as they’d learned the syntax of the language.
And since he knows C anyways, he might as well do whatever he wants. He hasn’t figured out all the advantages of using Java yet, but that’s to be expected when he’s only been using Java for a week.
What Euroboy should do is read some stuff like the links Orangy Tang posted. I don’t think file I/O is the problem. It’s just “newness” to Java.
[quote]What’s special about file I/O?
I can see telling someone not to start out with writing their own web server, but writing a program that reads some files is the sort of thing I would want people to start out doing as soon as they’d learned the syntax of the language.
And since he knows C anyways, he might as well do whatever he wants. He hasn’t figured out all the advantages of using Java yet, but that’s to be expected when he’s only been using Java for a week.
What Euroboy should do is read some stuff like the links Orangy Tang posted. I don’t think file I/O is the problem. It’s just “newness” to Java.
[/quote]
There’s nothing special about I/O, it’s just that the program above is a non-object oriented wrapper for an object-oriented API. Its primary application is to convert object orientedness to non-object orientedness. This is a logical thing to do when you’re a C programmer, yes, but doing more tutorial-like stuff will show that it isn’t the way to go in Java.