Compiling code

When im uploading java file and then compiling it, it is showing error in as “error: class xyz is public, should be declared in a file named xyz.java
public class xyz{”

@tushar.ghadge dont declare your class as public.

Just class xyz {
}