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 coderanch... This restriction is ... necessary for efficient package importation.
Ref:
Once Upon an Oak.