Which file extension stores Java bytecode?

Prepare for the Computer Programming Test. Study with flashcards and multiple choice questions, each question has hints and explanations. Get ready for your exam!

Multiple Choice

Which file extension stores Java bytecode?

Explanation:
Bytecode is the compiled form of Java that runs on the Java Virtual Machine and is stored in class files with the .class extension. When you write code in a file with a .java extension, you’re providing Java source code. Compiling that source with the Java compiler turns it into bytecode, which lives in a file like Hello.class and can be executed by the JVM regardless of your operating system. A .jar file, by contrast, is just a packaged archive that can contain many class files and resources; it’s used to distribute Java programs. There is no standard .bytecode extension in Java. So the file extension that stores Java bytecode is .class. For example, compiling Hello.java yields Hello.class.

Bytecode is the compiled form of Java that runs on the Java Virtual Machine and is stored in class files with the .class extension. When you write code in a file with a .java extension, you’re providing Java source code. Compiling that source with the Java compiler turns it into bytecode, which lives in a file like Hello.class and can be executed by the JVM regardless of your operating system. A .jar file, by contrast, is just a packaged archive that can contain many class files and resources; it’s used to distribute Java programs. There is no standard .bytecode extension in Java. So the file extension that stores Java bytecode is .class. For example, compiling Hello.java yields Hello.class.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy