what is the file name extension of a java source program
The file name extension of a Java source program is .java.
Quick Scoop
When you write a Java program, you save the code in a plain text file whose
name ends with .java. For example, a simple Hello World program might be
stored in a file named HelloWorld.java.
Key points
- Java source code files use the
.javaextension (e.g.,MyProgram.java).
- After compilation, Java produces bytecode files with the
.classextension (e.g.,MyProgram.class).
- The
.javafile is what you edit in an IDE or text editor; the.classfile is what the Java Virtual Machine (JVM) executes.
Tiny example
- You write code in
Student.java→ this is the Java source program.
- You compile it with
javac Student.java→ this generatesStudent.class.
- You run
java Student→ the JVM runs the.classbytecode.
So, if a multiple-choice or exam question asks:
“What is the file name extension of a Java source program?”
The correct answer is:.java.
TL;DR: The file name extension of a Java source program is .java.
Information gathered from public forums or data available on the internet and portrayed here.