If you have a public class named HelloWorld, then you should save that in a file named HelloWorld.java. Not: hello.java, Hello.java, helloworld.java or anything else. The name of the source file should be exactly the same as the name of the public class that it contains. Note that case matters for Java, even though filenames are not case-sensitive according to Windows.
Compile it from the command line with:
You should then have a file named HelloWorld.class. Run it with: