when we write two public class in a single file its give
error.(compilation error)
so,my question is why?what's the region behind this.
When Java finds a reference to a public class it can calculate what
the name of the corresponding class file is, and look for it on the
classpath. If it does not find it, it can find the corresponding
source file on the sourcepath. Without the naming convention it would
have to open every file on the sourcepath looking for it.
What puzzles me is why default scope classes can be packed more than
one into a source file. How does javac find THEM?