Example interpreting the cross-platform principle of Java

Source: Internet
Author: User

The first simple explanation of the Java cross-platform features is equivalent to saying that a Java program can run on different operating system platforms (the platform here is simply viewed as an operating system platform). Let's use some examples to illustrate its benefits.

We first understand some basic knowledge, the computer is composed of hardware and software, software is divided into system software and application software. Install the system software on the hardware first, install the application software on the system software, and they are compatible with each other, as shown in the following (Figure 3-1):

(Fig. 3-1)

Compatibility issues between software let's look at the following example (Figure 3-2):

(Fig. 3-2)

When we download the software, we often see such a picture, you can imagine that you use an Android phone to download an Apple version of the small Deanne software, the normal installation run it? Of course not. So we can understand that, in order to meet the different operating system users need to develop different versions of the small Deanne software, the workload is obviously very large. Wouldn't it be nice to develop a set of small Deanne software that could run directly on different operating systems?

The principles of the Java Cross-platform we can look at in such a few steps:

① first to install a JVM (Java Virtual machine) software on different operating systems;

② Compile the Java source files (. java files) into bytecode files (. class files);

The ③ then loads the bytecode file into the JVM, no matter what the operating system is, as long as it is installed in the Java operating environment;

④ Note: The JVM itself is also software, so different versions of the JVM need to be developed for different operating systems, but this does not bother our program ape, because the Java team itself has provided many of the JVM supported by the mainstream operating system.

In summary, Java implements its cross-platform features indirectly through the JVM (Java Virtual machine).

Example interpreting the cross-platform principle of Java

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.