Why same file name of java program as class name.?
this is not compulsory in my view. but in questions , it's answer is true. please explain.
To know which class contains main().
but we can compile the program with other name also. there is no problem. But while running the program we need to run with the class name which has java.
It is important when you use imports and packages as they don't refer directly to the class name but the file-structure