The first method of new Java
1 First right-click the mouse, create a new text document.
2 Change the text document to a suffix named. java. Note The file name must be the same as the class name.
If your computer does not display the suffix name, you need to set up a certain computer.
3 Open Computer-Organization-Folder Options-View-uncheck the hidden folder options.
This option is recommended to uncheck, there are a lot of malicious programs will invade our computer, uncheck can be very good to see the types of files such as viruses.
4 Right click on the built document, select Edit can be written in Java.
In writing we have a certain format, the Java language format for our future changes in the convenience of the rules, we must follow this format to write.
The second method
1 Create a new Notepad document, and then choose Save.
Note the save time position, do not wait until the save is not found where the file.
2 Enter the suffix ". Java" in the selected saved window and save it. Note The file name must be the same as the class name.
3 also right click on the file, select Edit can be edited in the file.
The first two curly braces between the carriage return, the second pair of braces have an interval, directly press the TAB key.
Test Run Java Program
Open the Run command, or you can enter CMD to invoke the command window directly in the Open menu.
Where your files are saved, enter your file directory into the command Prompt window, for example, mine is the D-Packing directory, so I type "D:".
Compiles a Java file and generates a class file.
At the command prompt, enter "Javac filename. java", my file name is a, so enter Javac A.java and then return to wait for compilation.
Run the file.
Continue typing "Java filename" and enter to run the file we have written.