A brief introduction to the running mechanism of Java programs in Java entry

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.

    1. The Americans translate the entire book so that you can read the book. This is a compiled version
    2. 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.

The principle of platform independence of the Java language
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.

Guess you like

Origin blog.csdn.net/qq_43361824/article/details/115003015