A file is a collection of data that is named and saved in the secondary storage (like on a disk or tape). The contents of a file can be retrieved and modified as per the requirements of the storage.
Every piece of data that is loaded in the primary or secondary memory of a computer is not a file. It is only when you save that data on the disk and name it suitably that the collection of data assumes the status of a file. Why use files? Read on. Primary memory is volatile; when you switch off the computer, everything that is stored in primary memory is lost. Therefore, it is necessary to save the data ...