Run of the Program

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:

There are four bytes per 32-bit value, so four ints will be 16 bytes.

Run of the Program

Here is a sample run of the program. The output file is 16 bytes long, as expected. The command window TYPE command will write a text file to the monitor. But with a "binary file" the bytes are not intended to represent characters, and TYPE writes garbage (not shown here).

C:/Programs>java  WriteInts

C:/Programs>dir

06/15/00  06:58p        <DIR>          .
06/15/00  06:58p        <DIR>          ..
06/15/00  06:58p                    16 intData.dat
06/15/00  06:57p                   944 WriteInts.class
06/15/00  06:57p                   581 WriteInts.java

C:/Programs>type intData.dat
               
C:/Programs>

QUESTION 5:

Could Notepad be used with intData.dat?