01
Language and Runtime
Measuring the chain from source to class file and virtual machine, the steps a program passes through from its entry point to termination, and the trace a package and an import leave in name resolution.
- 01 Source, Bytecode, and the Virtual Machine The source written in Java is not the thing that runs: eight of twelve methods carry a step in the class file that is absent from the source, 13 added steps counted in total; a concatenation sitting in the source, by contrast, is entirely absent from the class file.
- 02 Program Life Cycle The virtual machine counts as the entry point only the single signature satisfying four conditions at once; a class's static initializer runs not at the program's start but the moment the class is first used, and only once; an enum with two names written in the source carries three fields and five methods in the class file.
- 03 Packages and Imports An import is not a loading directive, it is a shorthand rule: class files produced when the same program is written with an import versus a fully qualified name are byte-for-byte identical, and a static import adds no step either; a package name, by contrast, changes the file, and two names cannot fit the same shorthand.