Hi,
I typed the below code in a file called test.java
class x
{
public static void main(
String args[])
{
System.out.println("In Main");
}
}
No Errors occurred during compilation and indeed a class (x.class) was created.
Error was reported only during runtime
(
java test).
Isn't the check for (NAME OF JAVA FILE SHUD MATCH CLASS NAME) done during compilation??
(When I made it public class x with the rest of the code same, it gave compilation error saying that x shud be stored in a file x.java )