Java study notes - Header

Each write Java programs will forget the main how to write code, he wrote down deliberately, then forget you can also Reviewing the Old.

Program apes Please do not despise me o (╯ □ ╰) o

public static void main(String[] args){

  ...

}

This is the entry address of the Java program, the Java virtual machine to run the program when the first look is the main method. Only a Java program main () method can only be executed Java virtual machine understandable format specified.

For inside the parameters and modifiers

public: This program represents the access , indicated that any occasion can be referenced, so the Java virtual machine can find main () method, which runs javac program
static: indicates that the method is static and does not depend on the object class of , belong to the class, the class loading when the main () method is also loaded into memory as
void: main () method is no return value

main: convention, the provisions of

String [] args: receiving a parameter from the console

  

Guess you like

Origin www.cnblogs.com/mandou-diu/p/11837219.html
Recommended