Simple comparison of "Java" C + + and Java

Source: Internet
Author: User
Reprint please specify the original address: http://www.cnblogs.com/ygj0930/p/5827273.html C + +: Compile (different systems compile different machine code, so the same C/C + + file can not be executed in some systems, because the compilation of Different machine code) code ———— machine code ———— in the operating system by the hard disk read into memory run--memory--cpu--output Java: Compiled bytecode run on the virtual machine, virtual machine equivalent to translation officer, different system JVM, different conversion rules , convert the same bytecode file to the corresponding system's machine code code ———— bytecode file (. Class) ———— JVM ———— machine code to run on the appropriate system-memory--cpu--results due to the existence of the JVM, it is only necessary to install the appropriate JVM on different systems. The same. class file runs on the JVM of the corresponding system and outputs the machine code that the corresponding system can parse to run successfully. This is, once compiled, run everywhere. For example, is: A book written in Chinese characters (source code), to different countries (systems), each country has a corresponding translation officer (JVM virtual machine) to translate the Chinese characters into the language of their country (such as the book to the English translation into the book), and then can be circulated in this country (equivalent to the successful operation of the program). Also, add: Java has two features: portability: Compile once, run everywhere (explained above) security: Automatically reclaims infrequently used command garbage in memory to prevent memory overflow.

Simple comparison of "Java" C + + and Java

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.