Hi Ernest,
Thanks for the explanation. Everything is clear except one point --
You could have a file containing three classes, none of them public, each with a main(), and the file could have a name unrelated to any of the classes.
A java file contains 3 classes "abc", "def", "ghi" and "abc" is public. All the 3 classes have the method main().
1. What will be the name of the java file ?
2. To run the program, java abc or java def or java ghi - all 3 will work ?