java error

i am a beginner while i run a java code or even when i upload it as a file i am getting a comiple error error: class ClassName is public, should be declared in a file named
public class ClassName{

Even though i have named the file as and its running in eclipse successfully

kindly help me

In the first line, it should be

public class Main

Remove public before class keyword.


Fdyuuu%%*## ggf###

Click to view