revised 01/18/99; 01/29/2000

CHAPTER 7 ---Running Example Programs without Typing: The Copy, Paste, Save, and Run Method

In future chapters you will see example Java programs that you will want to run. You could create a source file by opening Notepad then typing in the program while looking at the program in the browser window. Or, you could avoid re-typing the program by using Edit-Copy in the browser followed by Edit-Paste in Notepad. Now the file can be saved, compiled, and run as always.

If this is perfectly clear to you then you can skip this chapter. If not, this chapter walks you through these steps.

NOTES:

1. The steps are shown for a computer running Windows NT 4.0. Nearly the same steps can be used for Windows 95 and Windows 98, although using the DOS window is awkward.

2. If you are using a commercial Java programming environment (such as J++ or JBuilder) you can follow these steps, or can cut and paste into your environment's program editor. Even with a commercial Java environment it may be faster to follow these steps with Notepad and DOS because you do not have to set up the "project" your environent may require.

3. A small, but free, Java programming environment for Win 95, Win 98, and Win NT may be your best choice. See Appendix C.

Chapter Topics:

  • Overview of the Copy, Paste, Save, and Run Method.
  • Starting Notepad and DOS.
  • Copying text to the clipboard.
  • Pasting text from the clipboard into Notepad.
  • Saving the text as a source file.
  • Running the program.

QUESTION 1:

Is it sometimes benificial to type in a program rather than just copying it?

Click Here after you have answered the question