Running Example Programs

This chapter provides step-by-step instructions of writing a Java program using a text editor, and then compiling and running this program from command prompt. Several Integrated Development Environments (IDEs) are mentioned in this chapter. We have already installed NetBeans. That and Eclipse are the most popular in Java professional practice.

4. Step 2: Navigate


Usually you want Java programs in a folder on the hard drive C:

Step 2: Navigate


Left-click on C: in the left panel of the Explorer window. (You can also left-click on a USB drive if you have one plugged in.)

You will see something like the above. A view of files and folders is in the right panel. You can click on one of them to go into it, or make a new folder.

To make a new folder, RIGHT-click on C: then move the mouse pointer over NEW and then FOLDER.


LEFT-click on NEW. A new folder is created and visible in the left panel of Explorer. The name of the folder is highlighted. Type in a name for the new folder (JavaSource is used here.) Hit "enter".


You should have a new folder (subdirectory). Double LEFT-Click on it.


The contents of the folder is displayed in the right panel of Explorer. The folder will be empty if you just created it.


It may take several tries to get this far if you are not familiar with Windows operations.

Question 5:

How do you start a command window for the folder?