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