How to compile multiple Java files?

To compile multiple Java files, execute this command on the command-line: javac MyClass1.java MyClass2.java.

Just list those files after the javac command-line tool like so:

javac MyClass1.java MyClass2.java MyClass3.java