why the source file's name must be the same with the public class?
another quetion is : if the same source file contains more than one public classes ,which name should I take as the file name ? maybe the one contain the main method I think, but if all of them does not contain the main method, what should I do?
Originally posted by yang lei: ...if the same source file contains more than one public classes ,which name should I take as the file name? ...
Welcome to JavaRanch!
If the same source file contains more than one (top-level) public class, then it doesn't matter what you name it, because it won't compile.
The Oak 0.2 specification appears to suggest this was a performance optimization.
Although each Oak compilation unit can contain multiple classes or interfaces, at most one class or interface per compilation unit can be public... This restriction is ... necessary for efficient package importation.