Application that runs on the Internet such as WhatApp, Messanger, Facebook, WhatsApp, and Telegram, handle user information that is stored in file-based databases. What these all have in common is that they read and manipulate data in one way or another. Also, the data being handled is ultimately stored in some format in one or more files.

In this example, we pass system input System.in as a parameter ti the constructor of the Scanner class. The input if the user is directed into the input stream one line at a time, which means that the information is send to be handled every time the user enters a new line.

### Example:

File is read from the project root by deafault, when new Scanned(Path.get("example_file.txt")) is called. Folder that contains the folder src and the filepom.xml.

Read all the lines in the file, example:

## Reading data of a specific format from a file

Data is often stored in files using a specific format. One such format that’s already familiar to us is comma-separated values (CSV) format, i.e., data separated by commas.

## Reading Objects From a File

### Example:

Reading objects from a file is a clear responsibility in and of itself, and should for that reason be isolated into a method.