Introduction
How does Java work?
The goal is to write one application and have it work on whatever device your friends have.
- Source: Create a source document.
- Compiler: Run your document through a source code compiler. The compiler checks for errors and won't let you compile until it's satisfied that everything will run correctly.
- Ouput: The compiler creates a new document, coded into Java bytecode. Any device capable of running Java will be able to interpret/translate this file into something it can run. The compiled bytecode is platform-independent.
- Vitual Machines: Your friends don't have a physical Java Machine, but they all have a virtual Java machine running inside their electronic gadgets. The virtual machine reads and runs the bytecode.