I am working through several examples in a Java book. Why does the name of my program file have to match the name of my public class. I have other file with class that don't match the file name. Thanks! Mark
Well, for one, that is the way the java compiler works. And another reason is this is just good design. It makes sense that your .class file really be the name of your CLASS. What do you mean you have other files where the class names don't match the file name? I would suspect 2 things. 1. They won't compile 2. You are talking about inner classes. So you would still have your main Class that would be the same name as your File.