Solution:
A Java class file is a file with the .class filename extension that contains the Java bytecode that can be executed on the Java Virtual Machine (JVM). If a source file has more than one class, each class is compiled into a separate class file, but the main byte code is saved inside the .class file and that is named after the same of the public class of the java program.
I hope you get the answer.
Thanks.