Java main function

Source: Internet
Author: User

public static void Main (string[] args) "String args[]" Also

1) Public: The common permissions are the largest and can be accessed under any circumstances.

Cause: To ensure that the Java Virtual machine can access the main method under any circumstances.

2) Static: static. Static can make it easier for a Java virtual machine to call a function. You do not need to call with an object.

Not applicable to static modifiers:

1. You need to create an object call.

2.java virtual machines do not know how to create objects, because some of the objects that are created require parameters,

3) void: No return value returned. Because the return value is for the Java Virtual machine, and the Java Virtual machine uses this value is useless, do not.

4) Main: function name. (Note: Main is not a keyword but a special function name for Java virtual function recognition.) )

5) args (arguments): The reason is that some programs require parameters to start, but generally use Scanner scan = new Scanner (system.in);

Java main function

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.