[Java] I get told I need to put my program in a file with the same name as my class?

So the algorithm I tried to submit for asks that I make a program where the user submits input, and that is given as out put. The program stops when “42” os passed. I wrote and tested the program, but when I submit here I get an error that the program needs to be in a file with the same name as the class, even when I submit it as a properly named file. How should I proceed? Thanks.

File name CheckingAccount.java

import java.util.Scanner;

    public class CheckingAccount {
    public static void main(String args[]) {
       int input= 0;
        while(input != 42) {
            Scanner reader = new Scanner(System.in);
            input = reader.nextInt();
            boolean nani = false;


Name of the class has to be “Main” if the class is public.
Remove public from your class or change name to Main.