This content has been marked as final. Show 5 replies
Alternately, you may consider looking on amazon.com for a good beginner book on Java that has good reviews and reading it from cover to cover. Work through a number of the book's examples on the command line, then download Eclipse IDE to work through more of the examples. It will save you countless hours of trying to learn java by asking questions on forums and downloading code fragments off Google.
>1 person found this helpful
The second issue bother me is,should I put all class which belong to the same package in the same .java file ?
No - each class should be in its own file. The exception is when you declare a nested class used only by the declaring class.
should I declar "package PackageName" before every class?
Thanks to all reply to me, I keep looking for answer and try on my question.
Fortunately, I got what I need from rp0428 and here
I have to insert path between javac and .java file, thus java compiler will cretar folder automatically corresponding to packagetree.
Edited by: 956500 on Jan 30, 2013 3:57 PM
Edited by: 956500 on Jan 30, 2013 3:58 PM
Great, but don't rely on arbitrary and possibly garbage Internet sites. Java is documented in quite enough detail right here.