Package com.java_1; Public class Hello { publicstaticvoid main (string[] args) { System.out.println ("Hello world~~~");} }
This is the Java program's entry address, the Java Virtual machine runs the program when the first thing to look for is the main method. The function of the main () function is the same as the C language. Only the main () Method Java program can be the Java Virtual machine to line, can be understood as the specified format
for the parameters and modifiers inside
public access rights , which means that any occasion can be referenced so that the Java virtual machine can find the main () method to run the Javac program
static indicates that the method is static and does not depend on the object of the class. , which belongs to the class, the main () method is loaded into memory when the class is loaded
void Main () method is
main Conventions, rules, entry for all Programs
< Strong>string[] args receive parameters from the console
public static void in Java Main (string[] args)