A Java compiler converts source instructions for the Java virtual machine. The virtual machine code is stored in a class file with a
.class extension. Each class file contains the definition and implementation code for one class or interface. These class files must be interpreted by a program that can translate the instruction set of the virtual machine into the machine language of the target platform.
Note that the virtual machine loads only those class files that are needed for the execution of a program. For example, suppose program execution starts with
MyProgram.class. Here are the steps that the virtual machine carries out:
1. The virtual machine has a mechanism for loading class files—for example, by reading the files ...