Example Run

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to previous page   go to home page   go to next page        

Answer:

In the DOS window, use the DIR command to look at the directory. Or use the Windows file browser, Explore. In the Unix (or Linux) command prompt window use ls -l.

Since it is a text file, you can use the TYPE command (in DOS) or the cat command (in Unix) to see it on the screen.

Example Run

Here is a sample run. (Windows Explorer and Unix commands will show similar information):

C:/Programs>DIR

06/04/00  07:55p        <DIR>          .
06/04/00  07:55p        <DIR>          ..
06/04/00  07:55p                   693 WriteTextFile.class
06/04/00  07:55p                   475 WriteTextFile.java

C:/Programs>java  WriteTextFile

C:/Programs>DIR

06/04/00  07:56p        <DIR>          .
06/04/00  07:56p        <DIR>          ..
06/04/00  07:56p                   120 reaper.txt
06/04/00  07:55p                   693 WriteTextFile.class
06/04/00  07:55p                   475 WriteTextFile.java

C:/Programs>TYPE REAPER.TXT
Behold her, single in the field,
Yon solitary Highland Lass!
Reaping and singing by herself;
Stop here, or gently pass!

The listing shows that the file reaper.txt contains 120 bytes, including end of line characters.

QUESTION 5:

Could you edit reaper.txt with a text editor?