Water in the ocean 2022-01-26 13:32:38 阅读数:732
At last java Learning ！（ wuhu ！）
Of course , The most typical case at the beginning of all learning is of course our HelloWorld La , Today we'll learn how to use java Write a HelloWorld.
Create a java file , First, create a new text document where you want to create it , Change the name to the one you want ： Why don't you just HelloWorld Well （ It's better to be in English ）, At the same time, modify the suffix to .java, If no suffix appears, you can click on the upper left corner of the folder window file - Change folder and search options （ Options ）- see , Check out the extended name of hidden known file types , You can modify the file suffix .java The file is created
Open the file we created in the way of Notepad , Enter the following , Be careful public class Followed by the name of the file , And all the writing should use English characters, including punctuation marks , The case of letters should be the same , When you finish writing, you must remember Ctrl + S Save .
Because we just started learning java, I haven't downloaded some compilers yet , So this time with the help of cmd Command prompt to run our java file , First Win + R Open Command Prompt , Then enter the storage java File folder （ The location you created ）, For example, the place the author created is D A new disk java Folder
then , Input javac HelloWorld.java( The name of the file you created + suffix ）
After input , This file will appear in your folder （ Please ignore the author java File icon ）
Then input java HelloWorld（ file name ）, It will run ！！
If something goes wrong , Please point out ~ I will revise it in time ~~
Excuse me a lot ~~（）
copyright：author[Water in the ocean]，Please bring the original link to reprint, thank you. https://en.javamana.com/2022/01/202201261332355170.html