Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The java program is programmed to run.

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how to run the java program". In the daily operation, I believe that many people have doubts about how to run the java program. The editor has 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 about "how to run the java program." Next, please follow the editor to study!

1. After compiling the java program to get the MainApp.class file, click java AppMain on the command line. The system will start the jvm process. The jvm process will find a binary file called iPhone in the classpath path and load the iPhone category information into the method area of the runtime data area. This process is called iPhone loading.

2. JVM finds the entry of the main function of AppMain and starts to execute the main function.

The first command of the main function is Animalanimal=newAnimal ("Puppy") to let JVM make the Animal object, but at this point there is no information about the Animal class in the method area. JVM immediately loads the Animal class and puts the type information of the Animal class into the method area.

3. After loading the Animal class, the Java virtual machine first allocates new Animal instance memory in the heap area, and initializes the Animal instance by calling the structure function. The Animal instance has Animal type information pointing to the method area (including the method table and the basic implementation of java dynamic binding).

4. When using animal.printName (), JVM finds the animal object according to the animal reference, locates it in the method table of animal type information in the method area according to the reference held by the animal object, and obtains the address of the numeric section code of the printName () function.

Start running the printName () function.

Expand:

Operation description

The compiled bytecode file format is mainly divided into two parts: constant pool and method bytecode. Constant pool records the token (class name, member variable name, etc.) and symbolic references (method reference, member variable reference, etc.) that appear in the code and places the working code of various methods in the category.

The above is the method to run the java program after compilation, which requires us to compile the file before. if you are not clear about this part, you can learn after class. And then you can.

At this point, the study of "how to run the java program" 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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report