#What does public static void main mean?
public static void main means:
public static void main(String[] args), which is the entry address of the java program, java virtual machine When running a program, the first thing you look for is the main method.
1. Here we need to explain the main function. The parameter String[] args is a string array that receives parameters passed in when the program is executed. If you are on the console, you can pass the parameters in through compilation and execution. The command line is as follows:
2. What is passed into the main function is a string array, args[ 0] =a; args[1]=b;args[2]=c, If no parameters are passed in, args will be empty.
#3. Enter the parameters to be passed in Programmer arguments, separated by spaces a b c.
4. Before the vm attempts to run a class, it first checks whether the class contains a special method. This method must be public so that it can be accessed from anywhere.
#5. "Public" indicates the access rights of the program, which means it can be referenced on any occasion.
6. "static" means that the method is static and does not depend on the object of the class.
7. The "void:main()" method does not need to return a value.
Recommended tutorial: "java video tutorial"
The above is the detailed content of What does public static void main mean?. For more information, please follow other related articles on the PHP Chinese website!