Java Program operating mechanism

Source: Internet
Author: User

Computer high-level language according to the execution of programs can be divided into: compiled language and interpreted language.

Compiled language refers to the use of a specialized compiler, for a specific platform, the source program compiled into the platform can execute machine code (including machine instructions and operands), that is, the target program, after the end of the compilation, may also need to link other target programs, and ultimately generate an executable program to achieve the bottom level of reuse. The executable program generated by the compilation can be run independently of the development environment and on a specific platform. However, the program platform dependency of the compiled language is strong and needs to be recompiled when porting to other platforms. This kind of language existing C, c++,fortran,pascal and so on.

Interpreted language refers to the use of specialized interpreters for the source program line-by-row interpretation of the machine code on a specific platform, it will compile and interpret the mix together to complete, each execution of the interpretation of the language of the program is compiled once, so the efficiency is low, but there is a good cross-platform, only to provide a specific platform of the interpreter, can be interpreted as a machine instruction on the platform. The existing Ruby,python and other languages are explanatory languages.

Java is a special high-level language, it is both a compiled language and an interpreted language, it needs to be compiled and explained. First, the compiler compiles the platform-independent bytecode (that is, the. class file), and of course, this bytecode is not executable and must be interpreted with the Java interpreter. Who in the Java language is responsible for interpreting the execution of bytecode files? The--java virtual machine (JVM), on all platforms, provides an interface to the compiler to compile the virtual machine to understand the bytecode and then the virtual machine to interpret the execution.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/46/8E/wKiom1Py917TGiCqAADrWT6LxU0360.jpg "title=" Picture 1.jpg "Width=" "height=" 315 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:400px;height:315px; "alt=" Wkiom1py917tgicqaadrwt6lxu0360.jpg "/>

When compiling a Java program using the Java compiler, generate platform-independent bytecode, which does not need to target a specific platform, but only for the JVM. Different platforms have different JVMs, but they provide the same interface. The JVM is a key part of the Java cross-platform.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.