1--of the Java Language Foundation series using idea to write Helloworld__java

Source: Internet
Author: User

Open IntelliJ Idea and select "Create New Project" in the wizard

In the New Project tab, name Project, and this time we'll name the project HelloWorld

Click Next to proceed to the next step, and then click Finish to complete the creation.

In the project manager on the right, expand our "HelloWorld", right-click on "src" and create a new "Java Class" file

The previous step was to create a new ". Java" file. Its rules are the same as normal. java files.

If we write multiple classes in this file, then under SRC, all the classes will be expanded directly. But they are still in a. java file.

That is, the class shown in SRC is based on the. Class.

Then our Java source file name is "Helloworld.java"

Then write the code, in order to facilitate the interpretation of the above mentioned SRC situation, I wrote in the Helloworld.java two classes:

But we're not going to be able to execute this program, and we need to configure a little bit more.

Click "Edit configurations ...", in the open window midpoint "+", add a "application"

The term "Name" can be changed, and after the change, it looks more comfortable, we change it to "HelloWorld"

In the item "main class" to fill in the class name of the class containing the main function, the main function of our program is in class HelloWorld, here we fill in the HelloWorld

Other items do not need to be modified, just click "OK" to complete

And then we'll find that there's a little bit different here, which means starting from the main class HelloWorld.

Click on the green play symbol that represents "execute," and then a Java Project is done.

Git address: https://github.com/wenph/java_day_01am

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.