Java- primary main () method analysis

main () method signature

public static void main(String[] args) {
  ...
}

public modifier : Java classes, may be required by the JVM calls free call, the disclosure of which is required to main () call entry, which is exposed by the public modifier.
static modifier : The JVM calls main (), does not create the main class of the object, but the main method by calling the class directly. It belongs to the class level calls.
void return : After the JVM call, if the return value to the JVM, meaningless.
String [] args : string array parameter, who is calling, who is responsible for the assignment.

String array assignment

1) when running a Java program, the class name followed after one or more strings (separated by spaces), these strings will JVM sequentially assigned to the array args;
2) if the parameter contains a space, then the parameter double quotes ( "") package, otherwise it will be considered as a space for the jvm break character.

Guess you like

Origin www.cnblogs.com/Andya/p/12445182.html