First program and knowledge of java learning, first program of java Learning

Source: Internet
Author: User

First program and knowledge of java learning, first program of java Learning

I have also read a series of java programs before, but I have not officially typed them. Today I officially learned and typed out the code. Here we will record the daily income

 

Writing Tool: Notepad ++

Many people suggest using Notepad for writing tools, but I still think it is better to use Notepad ++ as an editing tool.

First Program
public class HelloWorld{    public static void main(String []args)    {        System.out.println("Hello World!");    }}

Let's analyze this program:

Execution Program

After the program is written, it is saved as a file with the suffix of java. We will illustrate this path.

E: \ java_lianxi \ TwoDay \ HelloWord. java

Note that the name of the saved file must be of the same type as that modified by public in the file. According to the code example above, the file name is HelloWorld. java.

After saving it, it is executed. Let's take a look at the java execution process.

In start -- run -- input cmd, run

Use the cd command to adjust the current location to the folder where the java source code file is located. If you do not need to use the cd command to switch the drive letter, enter the drive letter with a colon.

 

After the current location, you can run the javac command. After the javac command is executed, the HelloWorld. class file is generated,When executing this command, the file should be suffixed with a suffix

 

Then run the java command. Do not add a Suffix in java HelloWorld.

At this point, the first program is executed.

The following describes java features.

 

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.