Problem compiling SUMTRAN.. I am not using packages!!

Why am i getting compile error… I am not using any package in my code!! please help

this is the error Main.java:5: class Main1 is public, should be declared in a file named Main1.java public class Main1 { ^ 1 error

this is the code CodeChef: Practical coding for everyone

@timmy4all : For all submissions in JAVA on CodeChef , you should name your class “Main” and nothing else if your class is “public” . If you don’t declare the class “public” then you can name your class anything you want . Because whether you upload a file or paste code while submitting to the “online judge” copies its contents to Main.java .