Java Java programmers to share a good operation mechanism is

  Java programmers to share any good tutorial Java operating mechanism

  Java programmers to share any good tutorial Java operating mechanism, Java language is a popular programming language, because of its security, platform independence, performance and other characteristics, by the majority of programming enthusiasts. For the students want to learn Java language Java operating mechanism operating mechanism is necessary to understand.

  Java program is running, must be compiled and run in two steps. First suffix named Java source files to compile, and ultimately generate bytecode file suffix of .class. Then Java Virtual Machine bytecode files will be interpreted, and the results are displayed.

  In order to facilitate understanding of the process of running Java programs, we write down the concrete steps.

  ① write a Hello world.Java file.

  ② use "Javac Hello world.Java" command to open the Java compiler and compile it. After the compiler automatically generates a Hello World. Class bytecode files

  ③ use the "Java Hello world" command to start the Java virtual machine to run the program, the Java virtual machine is first compiled bytecode file is loaded into memory, a process known as class loading, which is done by the class loader, then virtual for all add to the inherent interpreted Java classes, you can see the results.

  Through the above analysis is not difficult to find, Java programs are responsible for the execution of the virtual machine interpreter, rather than the operating system.

  The advantage of this is that you can achieve cross-platform, which means that you can write the same program for different operating systems, simply install different versions of the virtual machine can be.

  

  As can be seen from the figure, different operating systems require the use of different versions of the virtual machine, the Java language in this way will have to have a "write once (write once, run anywhere)" feature, effectively solve the programming language problems different machine code at compile-time operating system, greatly reducing the cost of program development and maintenance.

  Note that, by the Java Virtual Machine Java program can achieve cross-platform features, but the Java virtual machine is not cross-platform. In other words, Java virtual machines on different operating systems are different, the Java virtual machine on a Windows platform can not be used on the Linux platform, and vice versa.

 

Guess you like

Origin www.cnblogs.com/gcghcxy/p/11127851.html