java file contains your Java source code while a . class file contains the Java bytecode produced by the Java compiler . It is your . class files that run on the JVM to execute a Java application.
What is the difference between a .java file and a .class file?
java file contains your Java source code while a . class file contains the Java bytecode produced by the Java compiler . It is your . class files that run on the JVM to execute a Java application.