[JAVA basic knowledge] Three stages of Java code in the computer

The three stages of Java code in the computer

1. Source source code stage: .java is compiled into *.class bytecode files, that is, java files are compiled into class bytecode files by javac according to member variables, construction methods, and member methods.

2. Class object stage: The .class bytecode file is loaded into the memory by the class loader and encapsulated into a Class object (used to describe the bytecode file in the memory), and the Class object will be in the original bytecode file The member variables of is extracted and encapsulated into an array Field[], the constructor in the original bytecode file is extracted and encapsulated into an array Construction[], and the member method is encapsulated into an array Method[]. In short, the member variables, construction methods, and member methods in the class file are loaded into memory through the class loader. Of course, there are more than these three in the Class class, but also a lot of encapsulation, we usually use these three.

3. RunTime runtime phase: the process of using new to create an object.
Insert picture description here
the above.


Disclaimer: This article only represents personal views. If you have different opinions, you are welcome to comment.
Reference blog post link: https://blog.csdn.net/Mr_wxc/article/details/105812627

Guess you like

Origin blog.csdn.net/qq_43148688/article/details/106076846