Joke Collection Website - Mood Talk - Briefly describe the editing, compiling and running process of JAVA program.

Briefly describe the editing, compiling and running process of JAVA program.

Step 1 (Compile): After creating the source file, first compile the program into a. class file. When compiling a class in Java, if the class on which the class depends has not been compiled, the compiler will compile the dependent class first, and then reference it, otherwise, reference it directly, which is a bit like make.

If the java compiler can't find it. Class file or. Specifies the java source file of the class it depends on in the directory, and the compiler will report the error "symbol not found".

Step 2 (Run): The process of java class running can be roughly divided into two processes: 1, class loading 2, and class execution. It should be noted that the JVM will only load this class when the program first actively uses it. That is to say, the JVM does not load the program into memory at the beginning, but only loads it when it must be used, and only once.

Special note: all public and protected instance methods in java classes adopt dynamic binding mechanism, and all private methods, static methods, constructors and initialization methods.

Extended data:

The whole process of compiling and running Java is quite complicated. This paper briefly explains the whole process through a simple program.

Java code compilation: completed by Java source code compiler;

The execution of Java bytecode is completed by JVM execution engine.

Java programs go through two main steps from source file creation to program running:

1. Compiler compiles source files into bytecode.

2. bytecode is interpreted and run by java virtual machine. Because java programs are compiled and interpreted by JVM, Java is called "semi-interpreted" language.