which extension is used to save the java program?
Extension for Java source code file is . java. After the compilation the compiler produces a . class file which contains java bytecode which can be executed on the Java Virtual Machine (JVM).