Java operating mechanism
Computer languages can be compiled or interpreted. compilation type: (C/C ++, Pascal/Object Pascal (Delphi) before executing a program written in the compilation type language, a special compilation process is required, compile the program into a machine-language file, such as an exe file. If you want to run the program later, you do not need to re-translate it. You can simply use the compiled result (exe file ), because only one translation is performed and no translation is required during the runtime, the execution efficiency of compiled languages is high.
Description:
(Java, JavaScript, VBScript, Perl, Python, Ruby, and MATLAB) can be translated only when a program is running, for example, an interpreted basic language, there is a special interpreter that can directly execute the basic program. Each statement is translated only when it is executed. In this way, each execution of an explanatory language requires a translation, which is less efficient.
Therefore, compilation efficiency is fast, and interpretation is applicable to multiple platforms.
Java Portability:
Java is an explanatory language. Although it is less efficient than the C language, it can run Java interpreters on different platforms (responsible for running the java virtual machine code on a specific platform ), achieve the goal of "writing once and running everywhere.
Java operating mechanism:
Java is a collection of two types. The extension of the Java source file is *. java. A *. class is generated through compilation, and then compiled files are executed through the Java Virtual Machine (JVM.
When analyzing the running mechanism of the Java language, two types of execution modes are usually discussed: the compilation process is similar to the daily life translation. The translation process is batch processing and offline. The C language is typical. similar to the International English pass-the speaker delivers a text and the other party's headset will have a corresponding English speech. At this time, the compilation is called the wired and timely features of the simultaneous transfer process. Typical representatives of the BASIC language class
The former loads java class files and gradually implements interpretation and execution of bytecode files, while the other commands correspond to the java language compilation process sequence. The java language must first compile the process and then explain the execution.
What is the operating mechanism of java? Embodiment: multithreading and parallel operation
Java Virtual Machine (JVM)