Home > Back-end >  The main method
The main method

Time:09-15

In Java code is executed in the main method? Is the main method to perform the end on behalf of the program be over?

CodePudding user response:

The main return is over,

CodePudding user response:

Just provide a running program entrance
If it is to run a framework class project, it is not so simple

CodePudding user response:

Java is essentially a multi-threaded, run in the JVM, the JVM opens a daemon thread, it will be when there is no a daemon thread to stop,

CodePudding user response:

A: in Java code is executed in the main method, the main method to perform the end means the end of the program, no problem!

The main function of the main thread, the entrance to a program, no main program won't run!
Note: a program is not necessarily a direct use of a main method, you can also use other forms such as: the junit testing tool, the tomcat server, the primary start classes in the springboot, etc., they are integrated with the main function,
And our own created by other functions, is the main function, the main thread of the child thread, the child thread is called in the main thread, may die (run) in advance, will die with the death of the main thread!

CodePudding user response:

What is your main?
1, in Java, the main () function function, is the entry of the program is running,
2, the main is the main thread of running, other functions are the main thread,
All procedures are carried out in the main in Java?
No, static blocks of code takes precedence over the main loading, not in the main,
Is the main method to perform the end on behalf of the program be over?
Yes, the main is the main thread, the main thread after the demise of other child thread is going to die,
  • Related