Java Overview
What 1.Java is:
Java is a pure face object language, with cross-platform, object-oriented, simple, security, distributed, multi-threaded and other characteristics.
2.Java What is the use of:
Java can write desktop applications, Web applications, distributed systems and embedded system applications, and so on, a nonsense: for programming.
operating mechanism of Java
1.Java programs run with two processes: Compile first, then parse (execute)
2. The computer language can be divided into two types according to the execution mode: compiled, interpreted
Compiled: Use a dedicated compiler to translate the source code into machine code for the operating system so that the platform can run the program. Language portability is poor in this way and is usually not portable.
Explanatory: Use a dedicated interpreter to interpret the source code as a machine code for a particular platform and execute it immediately. It is understood that a compilation must be performed each time an interpreter is executed, so this language is inefficient. However, portability is strong.
3.Java program operating mechanism and JVM
The execution of the 1.java program is also compiled first, but the special thing is that it compiles not the machine code but the bytecode (. class file), but the bytecode is not executable and needs to be interpreted by the Java interpreter. So the Java language can be said to be interpreted type, but also can be said to be compiled type.
2.JVM is the Java virtual machine used to interpret the execution of bytecode files. Different platform to implement the corresponding virtual machine, you can realize the platform operation is portable.
The Java Virtual Machine specification developed by 3.Oracle establishes a uniform standard for the JVM, ensuring the platform independence of the Java program, with the following details: 1. Instruction set 2. Format of the class file 4. Stack 5. Garbage collection heap 6. Storage area
4.JDK, JRE, JVM, the difference between the three and contact
1.JVM is a Java virtual machine that interprets the execution of a byte-code file
2.jre:java runtime Environment, which is the Java Runtime Environment
3.jdk:java Development Kit, Java Development Kit
4. So the JRE is the running environment that contains the JVM, only the Java program, just install the JRE, do not need the JDK. To develop a Java program, you need to install the JDK
Simple Java DOS window commands
1.javac Helloworld.java----This command to compile the Helloworld.java file into a helloworld.class file
2.java HelloWorld----This command interprets and executes the Helloworld.class file
Java Overview and operating mechanism