Files and Hardware

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:

Yes.

Files and Hardware

As far as the hardware of a computer system is concerned, all files look alike. Each file is regarded by hardware as a collection of bytes. (Remember that a byte is 8 bits.)

  • When a file is read the hardware delivers some of those bytes to the program.
  • When a file is written the hardware accepts some bytes from the program and saves them in part of the file.

The hardware makes no distinction between (say) image files and text files. Its all bytes to the hardware. What those bytes are used for is up to the software.

A hard disk is like a bookshelf with many books on it—novels, picture books, text books, note books... The bookshelf works the same for all books, since all books are fundamentally alike. Of course, some readers specialize in some kinds of books, but that is a "software" distinction, not a property of the storage hardware.

QUESTION 5:

The program Notepad processes text files but can make no sense of a MS Word file. Does this mean that those are fundamentally different file types?