Use the "Save As" menu option.
Click on the "File" menu in the upper left of Notepad. Select "Save-as".
The first time you do this, Notepad will show you some other folder than the one you want. You will need to "navigate" to the same folder you chose in step 2.
Save the example program as HelloPlanets.java.
(Of course, other programs will be saved to other files.)
Warning (1): In some older versions of Notepad you must use quote marks around the name of the file. So in the above you would type "HelloPlanets.java" (quotes included) into the File name box.
Warning (2): Some versions of Notepad require Save as type All Files.
Warning (3): Be sure that you pick Encoding ANSI.
Hopefully, the file
HelloPlanets.java has been saved to the folder
the same one that the command prompt window is using.
How can you confirm that this indeed happened?