Home > Java > Javagetting Started > body text

Introduction to java cross-platform principles

王林
Release: 2020-02-13 17:58:58
forward
3140 people have browsed it

Introduction to java cross-platform principles

(1) c/c is compiled into the corresponding platform, cross-platform needs to use the corresponding compiler to recompile

(2) java is the file (.java ) is compiled into a bytecode file (.class), and then the bytecode is interpreted into machine code on the java virtual machine

(3) The bytecode (.class) file is not oriented to any specific platform, only to Virtual machine

(4) The virtual machines of different platforms are different, but they have the same interface

(5) The Java language compiles the file once and runs it everywhere (as long as the platform it is running on is installed java virtual machine). So because of this principle, the performance of c/c is higher than that of java.

Recommended learning: java video tutorial

Introduction to java cross-platform principles

In layman’s terms, it is better to say that Java can be cross-platform than to say that Java virtual machine (jvm) is cross-platform. The platform is like a Chinese who goes to a foreign country. He needs to bring different translators to different countries. This translator is the virtual machine (jvm). What the Chinese speak is a .java file. The translator needs to translate what he speaks into the corresponding language. This It is a .class file, thus realizing the cross-platform of java. As long as there are corresponding jvm under different operating systems, it can be said that this system can execute java.

Recommended related articles and tutorials: java introductory tutorial

The above is the detailed content of Introduction to java cross-platform principles. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template