I know that in java the file name should always be same with class name.Suppose if the file name is test.java then the class name should be test.
But after I read this site question 8 tells that we can have empty class name.
Indirectly this means that file name is different from class name.
So I got confused and again searched in the internet and found these links Why are filenames in Java the same as the class name? and Can I compile a java file with a different name than the class?
Both says that class name should be equal to file name.
After that I tried to create a empty file in eclipse but its not allowing me.If do not enter file name then the finish button is not getting enabled.
Can anybody please tell me is the answer given in the webiste is right or wrong?
Note I know we can have different class name as that of file name provided that class should not be public .If the class is not public and file name is different from class name then JVM can not find main method