public static void Main (string[] args inside Java)

Source: Internet
Author: User

 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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.