Java Reference
In-Depth Information
public static void calculateBMI();
Code:
0: getstatic #22 // Field weight:D
3: getstatic #26 // Field height:D
6: getstatic #26 // Field height:D
9: dmul
10: ddiv
11: putstatic #44 // Field BMI:D
14: return
}
When compared to a pure interpreter technology, errors are detected during compilation time
instead of during execution time. When compared to a pure compiler technology, the portability
is better since this setup essentially implements a “write once, compile, run everywhere” strat-
egy so that every platform with a Java Virtual Machine can run Java bytecode. This is espe-
cially relevant in a networked (Internet) environment with many host systems having their own
specific platform.
Windows
Interpreter
BMI.class
BMI.java
Mac OS
public class BMIcalculator {
---------------------------------
------------------
------------
----------------
double weight;
double height;
double BMI;
Interpreter
....
Sun Solaris
Interpreter
Compiler
figure 2-1  
Java runtime environment (Jre)
The Java Runtime Environment (JRE) is the software environment in which Java programs run. It
consists of various components, as depicted in Figure 2-2.
The next subsections elaborate on the following components:
Java API (Application Programming Interface)
Class loader
Bytecode verifier
Java Virtual Machine (JVM)
 
Search WWH ::




Custom Search