One of the features of Java-cross-platform

Source: Internet
Author: User

    Before Java appeared, C and C + + were widely used programming languages at that time. But C and C + + have a common disadvantage, that is, can only be compiled on a specific platform. The platform referred to here is comprised of the operating system (OS) and processor (CPU). C and C + + source program on the specific platform to compile, connect its source files, generate the current platform machine instructions (platform machine instructions can be directly identified and executed by the platform), based on the current platform machine instructions to generate executable files . The executable can then be run on any platform that is the same as the current platform. But each platform will form its own unique machine instructions, the same CPU and different operating systems formed by the platform of the machine instructions may be different. If the equipment of the appliance is replaced, the platform cannot guarantee that the program will run correctly. You may need to modify the source program at this time and recompile the source program for the new platform. The biggest advantage of Java is that the software is written to run on all computers. This is done because Java can provide a Java runtime (Java runtime environment--JRE) on top of the computer's operating system, which is run by the Java Virtual machine (Java Virtual machine--JVM), class libraries, and some core files. The core of a Java Virtual machine is the bytecode instruction (the bytecode instruction can be identified and executed directly by the Java Virtual machine), the bytecode instruction is not a machine instruction, so it is not associated with a particular platform. Java Virtual machine for different platforms provided by the bytecode instructions are the same, first look at the Java program running process:

The compiler provided by the Java language is not compiled for a specific platform, but rather is compiled into bytecode (called "Intermediate Code") for the Java Virtual machine, and the bytecode is interpreted and run by the Java Virtual machine (the Java interpreter is part of the Java Virtual machine). The Java Virtual machine translates the bytecode into the machine instructions of the local computer and gives the machine instructions to the platform to run.

Is the collation of this blog post. For a more convenient and clear understanding, we can fill a theater: Vicido to study in the UK, with fluent English and handsome appearance, he met a lot of British friends. One day, he met a French beauty full of romantic amorous feelings. But unfortunately, he could not speak French, she could not English, so they could not communicate. Orange juice is a rich second generation, although he can only Chinese, but he has the money, hired a universal translator, together around the world is very happy ah no pressure ah.

Does the brain fill the story, is there any better to help you understand? In short, as long as the platform provides a Java runtime environment, software written in Java can be run on it.

This is the ending.

One of the features of Java-cross-platform

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.