Java learning notes 1 (HelloWorld), learning notes helloworld

Source: Internet
Author: User

Java learning notes 1 (HelloWorld), learning notes helloworld

Writing HelloWorld is a ceremony:

1. Download and install JDK. Note that no Chinese characters exist in the path.

2. Add environment variables and bin directory

3. Write a text with the following content and the suffix changed to. java. Note that the text name is HelloWorld and cannot be changed.

Public class HelloWorld {
Public static void main (String [] args ){
System. out. println ("HelloWorld ");
}
}

 

4. Compile after writing:

Open cmd To Go To The java file directory, and then: javac HelloWorld. java

A class file is generated, and then: java HelloWorld

Successful!

 

Additional:

Some common doscommands:

1. Open: win + R Enter cmd
2. Return to the upper-level Directory: cd ..
3. Return the root directory: cd \
4. Enter a directory: cd name
5. Switch the drive letter: cd d:
6. Combination: cd d: \ name (remember to change the drive letter)
7. Show All contents in the current directory: dir
8. Clear screen: cls
9. Check ip: ipconfig

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.