The file name extension of a Java source program is .java. This extension is used for the text files containing the Java source code written by the programmer. When the Java source file is compiled, it produces a bytecode file with the extension .class , which can be executed by the Java Virtual Machine (JVM)