class file
The file javac writes for each class, holding that class's bytecode plus a description of its fields and methods.
In more detail
A class file is not machine code for your processor; it is a portable binary format defined by the JVM specification. It records a class file version, so a JVM can refuse a file built for a newer Java release. Class files are what a JAR packages and what the JVM loads.
Examples
javac Hello.java # writes Hello.classls *.classRelated terms
- bytecode — A compact, portable instruction format that a virtual machine or interpreter executes, instead of instructions for one particular processor.
- class file version — The number stored in every class file that records which Java release it targets, so an older JVM can refuse a file from the future.
- javap — The JDK tool that prints what a class file contains, including its bytecode with -c and its class file version with -v.
- JAR file — A zip archive holding compiled classes and resources, plus a manifest describing them, which the JVM can load directly.
Taught in
- The Virtual Machine, The Kit And The Runtime — Modern Java: Virtual Threads & High-Throughput Services
- Release Trains And Long Term Support — Modern Java: Virtual Threads & High-Throughput Services
- The Lifecycle Of A Java Program — Modern Java: Virtual Threads & High-Throughput Services