1.3 How Java became what it is today. 4
2.2 Java as a Object Oriented language 5
3. VARIABLES, SCOPE, AND DATA TYPES 10
Java is a groundbreaking computing platform released by Sun Microsystems in 1995. It enables the same application to run on lots of different computers and devices. Java accomplishes this because the source code is translated to byte code (an intermediate code) and then interpreted by the Java Virtual Machine. Therefore, any computer with the JVM can execute a Java program. The process Java uses to execute programs is called a hybrid implementation system. It is called a hybrid because it is a compromise between compilers and pure interpreters implementation systems. This allows faster interpretation, but Java is still up to 20 times slower than C/C++.
Visually, here's the difference between traditionally compiled programs and Java programs.
o The compiler translates program into machine code or processor instructions. Those instructions are specific to the processor your computer is running. If you compile your code on an Intel-based system, the resulting program will run only on other Intel-based systems. If you want to use the same program on another system, you have to go back to your original source code, get a compiler for that system, and recompile the code so that you have a program specific to that system.
o The Java development environment has two parts: a Java compiler and a Java interpreter. The Java compiler takes Java program, instead of generating machine codes from source files; it generates byte-codes which are a special set of machine instructions that are not specific to any one processor or computer system.
o To execute a Java program, you run a program called a byte-code interpreter, which in turn reads the byte-codes and executes Java program. The byte-code interpreter is also called the Java virtual machine or the Java runtime.