Java Reference
In-Depth Information
Note The files that store compiled Java code are known as classfiles because they
often store the runtime representation ofJava classes, alanguage feature discussed in
Chapter 2 .
The Java language was designed with portability in mind. Ideally, Java developers
and run the bytecode on any platform (e.g., Windows, Linux, and Mac OS X) where
Javaissupported,withouteverhavingtochangethesourcecodeandrecompile. Port-
ability is achieved in part by ensuring that primitive types have the same sizes across
platforms. For example, the size of Java's integer type is always 32 bits.
part by not implementing certain C/C++ features that can make programs less robust.
Forexample, pointers (variablesthatstoretheaddressesofothervariables)increasethe
likelihood of program crashes, which is why Java doesn't support this C/C++ feature.
Java Is a Platform
Java is a platform that executes Java-based programs. Unlike platforms with physical
platform consists of a virtual machine and execution environment.
A virtual machine isasoftware-basedprocessorwithitsownsetofinstructions.The
JavaVirtualMachine(JVM)'sassociated execution environment consistsofahugelib-
raryofprebuiltfunctionality,commonlyknownasthe standard class library ,thatJava
lying operating system.
Note The “glue” code consists of platform-specific libraries for accessing the op-
erating system's windowing, networking, and other subsystems. It also consists of
code that uses the Java Native Interface (JNI) to bridge between Java and the oper-
ating system. I discuss the JNI in Appendix C. You might also want to check out
Java_Native_Interface ) to learn about the JNI.
to load a Java program's starting classfile into memory, via a component known as a
classloader . After the classfile has loaded, the following tasks are performed:
Search WWH ::

Custom Search