Getting started with Java
Java program operating mechanism
-
Compiled
-
Interpretive
I believe that most people who see these two words at first glance will be at a loss. Let me briefly describe them with two short stories.
There is a Chinese and an American. What should Americans do if they want to read Chinese books?
There are two ways.
- The Americans translate the entire book so that you can read the book. This is a compiled version
- Americans please translate, see which sentence translates which sentence, this is explanatory type
Because after translating a book, Americans can read it casually. It is simpler than reading a sentence to find a translation explanation. It can be concluded that the compiled type is relatively simpler than the interpreted type. But the compiled type also has some disadvantages.
Just update! If the Java program is updated, the compiled version cannot compile the updated content. But the interpretive type can do it.
Compiled type is mainly used by operating system, C, C++ and other compiled languages.
The interpretive type is mainly used by web pages, etc., which do not require high speed.
And our protagonist Java language can of course use two operating mechanisms.
As can be seen from the above figure, the Java source program is translated into the bytecode format of .class by the Java compiler, and then interpreted into the machine code that can be recognized by the major operating system platforms through the interpreter.