1.java understanding of main function

Source: Internet
Author: User

Public class HelloWorld {

Public static void< Span class= "Hl-code" > main ( String[] Args {

< Span class= "Hl-code" > system.out. Println ( "hello World )

< Span class= "Hl-code" > }

< Span class= "Hl-code" > } /span>

Note: String args[] and string[] args can be executed, but it is recommended to use the string[] args, which avoids ambiguity and misreading.

1. Compiling Java files

If you are compiling a Java file in the cmd command window,

1) You can use input: Javac Helloworld.java

2) Run Java file: Java HelloWorld

2. Perform Java command parsing:

Javac: Write the file name of the Java file, for example: Helloworld.java, which is used to compile the Java file into a class bytecode file, after the command is successfully run, If normal compilation occurs, the Java file directory will appear with the same name as the Java file but with the suffix. class file.

java: followed by the class name of the Java file, HelloWorld is the class name of the Helloworld.java file, only the class name of the Java file is required.

1.java understanding of 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.