This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
hi. I have a question regarding creating classes and saving them within files. When do I know whether to save the definitions of multiple classes in one .java file or whether I should only save one class inside one .java file. For instance, if I create a "people" class, should that be in its own people.java file, or can it be in a file with other classes.
Probably better to keep each class in its own file, unless they are private classes or inner classes. In fact, public classes must go in a file with the same name as the class (for most compilers), so you can't get two public classes into the same file.
By keeping each class in its own file, you (and the compiler) can quickly find out where each class is.