Originally posted by shekar krishna: Why do we need to save the file with that name of public class name?
Because that is how the language is defined. The motivation was to make it easier for the compiler to find source code, but ultimately the answer is that's the way Java is defined.
Originally posted by shekar krishna: If i dont what will happen?
Try it and see.
Originally posted by shekar krishna: Why it should be done?