The main function is generally written as follows:
Public static void main (string [] ARGs ){...}
The following describes the functions of these keywords:
(1) Public keyword. It is easy to understand that declaring the main function as public tells other classes to access this function.
(2) The static keyword tells the compiler that the main function is a static function. That is to say, the code in the main function is stored in the static storage area, that is, this code already exists after the class is defined. If the main () method does not use the static modifier, the compilation will not go wrong, but if you try to execute this program, an error will be reported, prompting that the main () method does not exist. Because the class containing main () is not instantiated (that is, the object without this class), its main () method will not be saved. The static modifier indicates that the method is static and can be used without instance.
(3) The Void keyword indicates that the return value of main () is of no type.
** (4) string [] args.
Public static void main (string [] ARGs) {} function understanding