0%

ClassFile

After a Java source file is compiled by javac, it becomes a .class bytecode file and then runs on the JVM. A ClassFile is a structured specification; all .class files must conform to this format. Alt text

Basic Info

Alt text

  1. magic number: 0xCAFEBABE. Every .class must start with these 4 bytes.
  2. Version number, representing the compiler (javac) version.
  3. access flags

Constant Pool

Alt text There are 14 kinds of constants, grouped into literals and symbolic references. Literals are strings, final constants, etc. Symbolic references are things like method names and field names; they point to a string entry, i.e., a literal.