1.5.1 Editing Java source code

Source: Internet
Author: User

Edit Java source code can use any unformatted text editor, on the Windows operating system can use Notepad (NotePad), EditPlus and other programs, on the Linux platform can use the VI tools and so on.

Note: writing a Java program does not use WordPad, nor can you use document editors such as word. Because tools such as WordPad, Word, and so on are formatted editors, when you use them to edit a document, the document contains some hidden formatting characters that cause the program to fail to compile and run correctly.

Create a new text file in Notepad and enter the following code in the file:

public class helloword{The entry method of the//java program, where the program will start executing public static void main (string[] args) {//Print a statement to the console    System.out.println ("Hello world!"); }}

When editing the above Java file, note the words that are identified in the program in bold (class, Helloword, System), and the Java program is strictly case-sensitive. Save the above text file as Helloworld.java, which is the source program for the Java program.

After writing the Java program's source program, the next step is to compile the Java source file to generate the bytecode.

1.5.1 Editing Java source code

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.