After installing and configuring Java's jdk, let's start writing the first java program--hello World. It is used to output "Hello World" on the console. First, we use the most primitive method, which is to use a text editor to write code. In any drive letter, take the root directory of drive D as an example, create a txt text in this directory, name it HelloWorld, and then change the suffix to java, that is, HelloWorld.java.
Then open the editing code, as follows:
Finally, in order to output "HelloWorld", compile this .class file and enter "java HelloWorld" in the console. As shown in the picture:
This completes the first java program, which is very simple. In fact, in order to facilitate learning, we'd better create a special file on a disk to write a java program. For example, create a directory named "java" under the D drive, and then write the program in this directory. At the beginning, it is best to use text to write programs instead of integrated development environments, such as eclipse, etc., because this will exercise the ability to write code specifications.