I have a file Test.java and the following code inside it.
public class Abcd
{
//some code here
}
Now the class does n
I look at it the other way round. The natural state of affairs would be for the programmer to pick both the class name and the file name independently. Probably in order to simplify finding public classes from outside a package during compilation, there is a special restriction that a public class be in a file with the corresponding name.