The meaning of the main method String [] args in Java

public static void main(String[] args)

There is no difference between String args[] and String[] args. Both can be executed, but String[] args is recommended to avoid ambiguity and misunderstanding.

In Java, args generally exist in the main main class method. String args[] or String[] args means to pass a string array to the main method. And args is the variable name of a string array, not a keyword, but an abbreviation for arguments. It's just a default name, and it's usually habitually written down.

Guess you like

Origin blog.csdn.net/Mr_zhang66/article/details/114253255