In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "the process instance analysis of java class loading". In the daily operation, I believe that many people have doubts about the process instance analysis of java class loading. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "process instance analysis of java class loading". Next, please follow the editor to study!
Description
When a program actively uses a class, if the class has not been loaded into memory, the system initializes the class through the following three steps.
Class loading step
1. Load: load the bytecode contents of the class file into memory, convert the static data into the run-time data structure of the method area, and then generate a java.lang.Class object representing this class as the access entry for the class data in the method area.
2. Link: the process of merging the binaries of the Java class into the running state of JVM.
3. The process of executing the class constructor () method.
Example
Public class ClassLoadingTest {public static void main (String [] args) {System.out.println (test.m);}} class test {static {m = 300;} static int m = 100 } / / first step: load / / second step: after the end of the link, m is determined by () method execution / * the test constructor () method is generated by the assignment of class variables and the sequential merging of statements in the static code block, similar to () {m = 300 × m = 100 At this point, the study on "process instance analysis of java class loading" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.