previous | start | next

Execution

The java byte code in the Hello.class file is similar to machine code, but is not the same and cannot be executed directly like programs that have been compiled (translated) to machine code.

Instead, another program called java, opens the Hello.class file and reads and executes the byte code instructions in that file.

The java program plays the same role in executing byte code as the hardware machine does in executing machine instructions.

For this reason, the java program is referred to as the java virtual machine.

The java program only works for .class files and assumes that any file given to it will have the .class extent.

So the .class part of the name should be omitted when executing Hello.class:

      java Hello
   


previous | start | next