The first Java program

Source: Internet
Author: User

complete your first Java program

1. Create a new text document and write the code of your first Java program in the text document as follows ;

Class Hello

{

public static void Main (string[] args)

{

System.out.println ("Hello i Miss You")

}

}

2. Save the written code and change the text document to a Java type

3. Open the Command Window at the Java file and compile the java file just written with Javac , if the compilation is successful, in Java a class file named Hello is automatically generated under the file .

4. run the generated class file in Java in the Command Window , and the window will output the "hello i miss you" in our code. "up. The first Java program is completed.

Here we re-complete our program with the Eclipse tool

1. Open Eclipse, enter the Workbench, create a new Java project and name it

2. at this point, the left window will appear under our new project, we expand the project on the SRC right-click on the Select New class and name it, then our code editing interface appears.

3. write our code, run it in the toolbar, complete our first Java program

Finally, to summarize today's content; Mind map as follows ;

Job Code ;

Package zw001;

Public class Hello

{

Public Static void Main (string[] args)

{

System. out. println ("####### # #");

System. out. println ("# # #");

System. out. println ("###### ############");

System. out. println ("# # #");

System. out. println ("####### # #");

System. out. println ("# # #");

System. out. println ("####### ##### #");

System. out. println ("");

System. out. println ("");

System. out. println ("");

System. out. println ("# #");

System. out. println ("# #");

System. out. println ("# ########");

System. out. println ("# #");

System. out. println ("# #####");

System. out. println ("# #");

System. out. println ("# ##################");

System. out. println ("# # #");

System. out. println ("# # #");

System. out. println ("# #");

}

}

The effect is as follows ;

The first Java program

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.