How to use java notepad?
Create a new document on the desktop, rename "HelloWorld", and change the txt suffix to "java".
Recommended tutorial: "java learning"
Edit the content of "HelloWorld.java":
public class HelloWorld { public static void main(String[] args) System.out.println("welcome to baidu!!!"); } }
Save the file and put it into the D drive (the path is optional).
Note: "System.out.println("xxx");" is the output statement, and "xxx" can be any other content.
Enter the "CMD" command in the start bar of the computer to open the DOS command line:
DOS command> D: (Press Enter to enter the root directory of the D drive )
DOS Command> dir (Press Enter to view the files in the current directory)
DOS Command> javac HelloWorld.java (Press Enter to compile the .java source file)
DOS command> java HelloWorld (Press Enter, load and run the .class bytecode file)
The content displays: welcome to baidu!!!
The above is the detailed content of How to use java notepad. For more information, please follow other related articles on the PHP Chinese website!